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

install error osx #64

Open
fipoucat opened this issue Dec 12, 2020 · 5 comments
Open

install error osx #64

fipoucat opened this issue Dec 12, 2020 · 5 comments

Comments

@fipoucat
Copy link

I ma trying to install gridpp on mac but keep getting error.

Building wheels for collected packages: gridpp
Building wheel for gridpp (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-3q_szwe5/gridpp_a06d2a2a72914e7886507b1e05c05784/setup.py'"'"'; file='"'"'/private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-3q_szwe5/gridpp_a06d2a2a72914e7886507b1e05c05784/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-wheel-vw19civz
cwd: /private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-3q_szwe5/gridpp_a06d2a2a72914e7886507b1e05c05784/
Complete output (14 lines):
running bdist_wheel
running build
running build_ext
building '_gridpp' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src

Hope help or guidance to solve this error.
Thanks

@tnipen
Copy link
Member

tnipen commented Dec 12, 2020

Was that the entire error message, or was there more? It's a bit hard to tell what went wrong here :)

@fipoucat
Copy link
Author

Below entire error message:

Building wheels for collected packages: gridpp
Building wheel for gridpp (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-3q_szwe5/gridpp_a06d2a2a72914e7886507b1e05c05784/setup.py'"'"'; file='"'"'/private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-3q_szwe5/gridpp_a06d2a2a72914e7886507b1e05c05784/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-wheel-vw19civz
cwd: /private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-3q_szwe5/gridpp_a06d2a2a72914e7886507b1e05c05784/
Complete output (14 lines):
running bdist_wheel
running build
running build_ext
building '_gridpp' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src
creating build/temp.macosx-10.9-x86_64-3.8/src/api
/usr/local/bin/gcc-10 -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I./include -Iboost_1_74_0 -Iarmadillo-9.800.5/include -I/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/api/calc_gradient.cpp -o build/temp.macosx-10.9-x86_64-3.8/src/api/calc_gradient.o -Wall -Wfatal-errors -Wno-reorder -Wno-sign-compare -Wl,-init,initialize_omp -fopenmp
src/api/calc_gradient.cpp:1:10: fatal error: gridpp.h: No such file or directory
1 | #include "gridpp.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/local/bin/gcc-10' failed with exit status 1

ERROR: Failed building wheel for gridpp
Running setup.py clean for gridpp
Failed to build gridpp
Installing collected packages: gridpp
Running setup.py install for gridpp ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-3q_szwe5/gridpp_a06d2a2a72914e7886507b1e05c05784/setup.py'"'"'; file='"'"'/private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-3q_szwe5/gridpp_a06d2a2a72914e7886507b1e05c05784/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-record-bp6zoyxz/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/sarr/Library/Python/3.8/include/python3.8/gridpp
cwd: /private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-3q_szwe5/gridpp_a06d2a2a72914e7886507b1e05c05784/
Complete output (13 lines):
running install
running build_ext
building '_gridpp' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src
creating build/temp.macosx-10.9-x86_64-3.8/src/api
/usr/local/bin/gcc-10 -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I./include -Iboost_1_74_0 -Iarmadillo-9.800.5/include -I/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/api/calc_gradient.cpp -o build/temp.macosx-10.9-x86_64-3.8/src/api/calc_gradient.o -Wall -Wfatal-errors -Wno-reorder -Wno-sign-compare -Wl,-init,initialize_omp -fopenmp
src/api/calc_gradient.cpp:1:10: fatal error: gridpp.h: No such file or directory
1 | #include "gridpp.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/local/bin/gcc-10' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-3q_szwe5/gridpp_a06d2a2a72914e7886507b1e05c05784/setup.py'"'"'; file='"'"'/private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-3q_szwe5/gridpp_a06d2a2a72914e7886507b1e05c05784/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-record-bp6zoyxz/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/sarr/Library/Python/3.8/include/python3.8/gridpp Check the logs for full command output.

@tnipen
Copy link
Member

tnipen commented Dec 13, 2020

Thanks for the error report! I think I've fixed the problem with the source distribution. Could you try installing with the newest release (0.5.3) from pip? Let me know if that doesn't work.

@fipoucat
Copy link
Author

I tried again but still getting error?
pip install gridpp --user
Collecting gridpp
Using cached gridpp-0.5.3.tar.gz (164 kB)
Requirement already satisfied: numpy>=1.7 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from gridpp) (1.18.4)
Building wheels for collected packages: gridpp
Building wheel for gridpp (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-u3yau5is/gridpp_a1bef123431c4e2fa90feb84f83acc3f/setup.py'"'"'; file='"'"'/private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-u3yau5is/gridpp_a1bef123431c4e2fa90feb84f83acc3f/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-wheel-iyu0onwd
cwd: /private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-u3yau5is/gridpp_a1bef123431c4e2fa90feb84f83acc3f/
Complete output (12 lines):
running bdist_wheel
running build
running build_ext
building '_gridpp' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src
creating build/temp.macosx-10.9-x86_64-3.8/src/api
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I./include -I/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/api/calc_gradient.cpp -o build/temp.macosx-10.9-x86_64-3.8/src/api/calc_gradient.o -Wall -Wfatal-errors -Wno-reorder -Wno-sign-compare -Wl,-init,initialize_omp -fopenmp -std=c++98
clang: warning: -Wl,-init,initialize_omp: 'linker' input unused [-Wunused-command-line-argument]
clang: fatal error: unsupported option '-fopenmp'
error: command 'gcc' failed with exit status 1

ERROR: Failed building wheel for gridpp
Running setup.py clean for gridpp
Failed to build gridpp
Installing collected packages: gridpp
Running setup.py install for gridpp ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-u3yau5is/gridpp_a1bef123431c4e2fa90feb84f83acc3f/setup.py'"'"'; file='"'"'/private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-u3yau5is/gridpp_a1bef123431c4e2fa90feb84f83acc3f/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-record-m_26ya7r/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/sarr/Library/Python/3.8/include/python3.8/gridpp
cwd: /private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-u3yau5is/gridpp_a1bef123431c4e2fa90feb84f83acc3f/
Complete output (11 lines):
running install
running build_ext
building '_gridpp' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src
creating build/temp.macosx-10.9-x86_64-3.8/src/api
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I./include -I/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/api/calc_gradient.cpp -o build/temp.macosx-10.9-x86_64-3.8/src/api/calc_gradient.o -Wall -Wfatal-errors -Wno-reorder -Wno-sign-compare -Wl,-init,initialize_omp -fopenmp -std=c++98
clang: warning: -Wl,-init,initialize_omp: 'linker' input unused [-Wunused-command-line-argument]
clang: fatal error: unsupported option '-fopenmp'
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-u3yau5is/gridpp_a1bef123431c4e2fa90feb84f83acc3f/setup.py'"'"'; file='"'"'/private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-install-u3yau5is/gridpp_a1bef123431c4e2fa90feb84f83acc3f/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/wb/pry3ghxn4s30_yrgyynbrxs80000gn/T/pip-record-m_26ya7r/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/sarr/Library/Python/3.8/include/python3.8/gridpp Check the logs for full command output.

@khintz
Copy link
Contributor

khintz commented Jun 8, 2023

For Mac Os X ARM64 (Ventura 13.4) it was relatively straightforward to build and install gridpp from source (although not as easy as just doing a pip install).

I used homebrew to install armadillo, and made sure to use my gcc installation instead of apple clang compiler, which gave me an error with libquadmath. Below are the steps I followed. Hereafter I was able to import and use gridpp from python.
Note that I also disabled to R build since I don't need that.

brew install armadillo
git clone https://github.com/metno/gridpp.git
cd gridpp
mkdir -p build && cd build
CC=/opt/homebrew/bin/gcc-13 CXX=/opt/homebrew/bin/g++-13 LD_LIBRARY_PATH="/opt/homebrew/lib" cmake -DCMAKE_INSTALL_PREFIX=$HOME/sw/ -DPYTHON_INCLUDE_DIR=$(python -c "import sysconfig; print(sysconfig.get_path('include'))") -DPYTHON_LIBRARY=$(python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))") -DBUILD_R=OFF ..
make build-python

cp extras/SWIG/python/gridpp.py  $(python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")/python3.1/site-packages/gridpp.py
cp extras/SWIG/python/_gridpp.so $(python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")/python3.1/site-packages/_gridpp.so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants