Skip to content
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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cmake/FindCython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ find_package(Python 3.6)
if(Python_Interpreter_FOUND)
get_filename_component( _python_path ${Python_EXECUTABLE} PATH )
find_program( CYTHON_EXECUTABLE
NAMES cython${Python_VERSION_MAJOR} cython-${Python_VERSION_MAJOR}.${Python_VERSION_MINOR} cython cython.bat
NAMES cython cython.bat cython${Python_VERSION_MAJOR} cython-${Python_VERSION_MAJOR}.${Python_VERSION_MINOR} cython3
HINTS ${_python_path}
)
else()
Expand All @@ -37,7 +37,8 @@ else()
)
endif()


message( "The Python path is ${_python_path}")
message( "The Cython Executable is ${CYTHON_EXECUTABLE}")
include( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( Cython REQUIRED_VARS CYTHON_EXECUTABLE )

Expand Down
6 changes: 6 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

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.


#If "conda install gxx_linux-64 / clangxx_osx-64"
> CXX=${CXX} cmake -DCMAKE_INSTALL_PREFIX=../install ../src/fringe
Copy link
Member

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.


Expand All @@ -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:
Copy link
Member

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.

export GDAL_DIR=base-anaconda-directory/envs/fringe/
Copy link
Contributor

@scottstanie scottstanie Sep 11, 2020

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 ..

Copy link
Member

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.

Copy link
Contributor

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.