Skip to content

Commit 621680d

Browse files
committed
Add pythonlib flags in C auto-execution
1 parent c4d2f45 commit 621680d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/bin/lpython.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,9 @@ int link_executable(const std::vector<std::string> &infiles,
12461246
cmd += " -I " + rtlib_header_dir;
12471247
cmd += " -L" + base_path
12481248
+ " -Wl,-rpath," + base_path + " -l" + runtime_lib + " -lm";
1249+
std::string py_version = "3.10";
1250+
std::string py_flags = R"(-I $CONDA_PREFIX/include/python)" + py_version + R"( -L$CONDA_PREFIX/lib -Wl,-rpath -Wl,$CONDA_PREFIX/lib -lpython)" + py_version + R"()";
1251+
cmd += " " + py_flags;
12491252
int err = system(cmd.c_str());
12501253
if (err) {
12511254
std::cout << "The command '" + cmd + "' failed." << std::endl;

0 commit comments

Comments
 (0)