Comments (2)
thanks for the help! the least intrusive option turned out to be building with -DPython3_FIND_VIRTUALENV=ONLY
SOURCE_DATE_EPOCH=`date +%s` cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_PYBIND=ON -DUSE_OPENLIBM=ON -DUSE_SINGLE_PRECISION=ON -DCERES_TINY_SOLVER=ON -DPython3_FIND_VIRTUALENV=ONLY
from operon.
Hmm, maybe we can use pkg-config
as a workaround. Could you try this patch:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d5af4c8..80f2c3c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,9 +20,9 @@ find_package(Eigen3)
find_package(Ceres)
find_package(Threads)
find_package(TBB)
-find_package(Python3 COMPONENTS Development Interpreter)
find_package(pybind11)
find_package(doctest)
+find_package(PkgConfig REQUIRED)
# operon library
set_package_properties(Git PROPERTIES TYPE REQUIRED)
@@ -36,7 +36,7 @@ set_package_properties(doctest PROPERTIES TYPE OPTIONAL) # unit tests
set_package_properties(cxxopts PROPERTIES TYPE OPTIONAL) # command-line parser
# python binding
-set_package_properties(Python3 PROPERTIES TYPE OPTIONAL)
+pkg_check_modules(Python3 python-3.7 REQUIRED)
set_package_properties(pybind11 PROPERTIES TYPE OPTIONAL)
# get revision information from git
My hope is that pkg-config
inside the conda environment will find the correct python version.
EDIT: I tested this by forcing python-3.7 inside the conda env, it works, but CMake is no longer able to autodetec the install path, so it should be specified explicitly:
CC=gcc-9 CXX=g++-9 cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_SINGLE_PRECISION=ON -DBUILD_PYBIND=ON -DUSE_OPENLIBM=ON -DCERES_TINY_SOLVER=ON -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX/lib/python3.7/site-packages/
This works for now, however I am a bit reluctant to commit this fix since it still seems more like a workaround.
EDIT2:
Another couple options that might work:
- Use
find_package(Python3 3.x.x EXACT REQUIRED)
to match an exact version. - Use
-DPython3_ROOT_DIR
to tell CMake where to find the Python3 installation
from operon.
Related Issues (20)
- TypeError: __init__(): incompatible constructor arguments HOT 1
- ValueError: Input contains NaN, infinity or a value too large for dtype('float32'). HOT 3
- Add option to disable evolution / optimization of variable coefficients (fix coefficients to one) HOT 2
- Usage instructions for command line interface do not show all supported symbols for --enable-symbols and --disable-symbols. HOT 1
- Python bindings HOT 6
- Evidential regression? HOT 3
- Building python binding and packaging HOT 2
- building operon HOT 9
- Can't build on linux HOT 1
- buliding problem HOT 3
- error in cmake HOT 4
- double free or corruption (out) HOT 8
- Custom cost function HOT 3
- Question about running ctest based on the instructions in HACKING.md HOT 5
- Building operon fails with a compiler error HOT 2
- Where can I find a c++ example of using operon? HOT 5
- About implementing specific custom primitives HOT 7
- Typo in selection operator definition produces segfault on CLI HOT 1
- Update license and file headers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from operon.