-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update paths when using Ananaconda #20
Conversation
jlmaurer
commented
May 15, 2020
•
edited
Loading
edited
- Change FindCython.cmake search order so that it finds the conda version of cython
- Add -DCMAKE_PREFIX_PATH=$CONDA_PREFIX to installation command when using anaconda
- Without these changes, Fringe can get the system versions of these two packages
- This PR fixes Fringe cmake can't find GDAL #9.
Alternatively you can invoke cython with |
Also, when you're using anaconda, I recommend passing |
@rtburns-jpl and @piyushrpt, do you recommend I add the '''-DCMAKE_PREFIX_PATH=$CONDA_PREFIX''' argument to the current PR? This would I think also require adding an export command for the CONDA_PREFIX. |
You'd provide |
Oh, I see what you mean about the CONDA_PREFIX export - that variable is automatically set by conda to your currently active environment, so no need to export it yourself :) |
@rtburns-jpl Got it. I'll add the command arg to the install.md example. |
When using conda compilers, you dont need to specify CXX
is redundant |
@@ -81,6 +81,9 @@ In the build folder | |||
#On Linux | |||
> CXX=g++ cmake -DCMAKE_INSTALL_PREFIX=../install ../src/fringe | |||
|
|||
# with anaconda (on Linux) | |||
> CXX=g++ cmake -DCMAKE_INSTALL_PREFIX=../install ../src/fringe -DCMAKE_PREFIX_PATH=$CONDA_PREFIX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer adding the CONDA_PREFIX as a solution just like the GDAL one, in a later section below. I havent had to do this for GDAL / cython on couple of different setups.
@@ -81,6 +81,9 @@ In the build folder | |||
#On Linux | |||
> CXX=g++ cmake -DCMAKE_INSTALL_PREFIX=../install ../src/fringe | |||
|
|||
# with anaconda (on Linux) | |||
> CXX=g++ cmake -DCMAKE_INSTALL_PREFIX=../install ../src/fringe -DCMAKE_PREFIX_PATH=$CONDA_PREFIX | |||
|
|||
#If "conda install gxx_linux-64 / clangxx_osx-64" | |||
> CXX=${CXX} cmake -DCMAKE_INSTALL_PREFIX=../install ../src/fringe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CXX=${CXX} is redundant when using conda compilers since these are automatically set when the environment is activated. I would remove that.
@@ -99,3 +102,6 @@ export PYTHONPATH=$PYTHONPATH:path-to-install-folder/python | |||
|
|||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:path-to-install-folder/lib | |||
``` | |||
If using within an Anaconda environment: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to make this a sub-section to capture the quirks that you have to deal with, especially for conda.
@@ -99,3 +102,6 @@ export PYTHONPATH=$PYTHONPATH:path-to-install-folder/python | |||
|
|||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:path-to-install-folder/lib | |||
``` | |||
If using within an Anaconda environment: | |||
export GDAL_DIR=base-anaconda-directory/envs/fringe/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of also making a small PR on this issue that I ran into- I ended up changing it at during the cmake
command by adding
GDAL_DIR=`gdal-config --prefix` cmake -DCMAKE_INSTALL_PREFIX=../install ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, was this due to using a system installation of gdal? In my experience I always use gdal from conda so -DCMAKE_PREFIX_PATH=$CONDA_PREFIX is sufficient, but this is a neat trick in the general case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh you are right! I had mixed it up with another setup that didn't have the anaconda gdal. The -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
was indeed sufficient for the conda gdal install.
Hi @jlmaurer, The #51 fixes the build on ci and also on local linux machine with conda. As mentioned here and in #51 we don't want to change the order for cython. My suggestion is to update this PR by removing the change to CMake for finding cython and with special cases where we specifically need to enforce such as the following:
Or we can just close this PR and update the installation in a separate PR. Let me know what makes better for you. |
@jlmaurer I'll close this PR for now as I'm going to rename the master to main. Feel free to re-open and update please if you think it is still needed. |