jhkorhonen / MOODS

MOODS: Motif Occurrence Detection Suite
Other
95 stars 12 forks source link

mac installation #8

Closed jorgeboucas closed 7 years ago

jorgeboucas commented 8 years ago

Hi,

just in case someone is also having problems installing on a mac El Capitan (10.11.14).

I just took the idea from here: https://github.com/wesm/feather/issues/61

Error:

python setup.py install

running install
running build
running build_py
running build_ext
building 'MOODS._tools' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/tools_wrap.cxx -o build/temp.macosx-10.6-intel-2.7/core/tools_wrap.o -march=native -O3 -fPIC --std=c++0x
In file included from core/tools_wrap.cxx:3139:
core/moods.h:8:10: fatal error: 'cstdint' file not found
#include <cstdint>
         ^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1

Fix:

export MACOSX_DEPLOYMENT_TARGET=10.10

python setup.py install

running install
running build
running build_py
running build_ext
building 'MOODS._tools' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/tools_wrap.cxx -o build/temp.macosx-10.6-intel-2.7/core/tools_wrap.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/moods_tools.cpp -o build/temp.macosx-10.6-intel-2.7/core/moods_tools.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/moods_misc.cpp -o build/temp.macosx-10.6-intel-2.7/core/moods_misc.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/match_types.cpp -o build/temp.macosx-10.6-intel-2.7/core/match_types.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang++ -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/core/tools_wrap.o build/temp.macosx-10.6-intel-2.7/core/moods_tools.o build/temp.macosx-10.6-intel-2.7/core/moods_misc.o build/temp.macosx-10.6-intel-2.7/core/match_types.o -o build/lib.macosx-10.6-intel-2.7/MOODS/_tools.so
building 'MOODS._scan' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/scan_wrap.cxx -o build/temp.macosx-10.6-intel-2.7/core/scan_wrap.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/moods_scan.cpp -o build/temp.macosx-10.6-intel-2.7/core/moods_scan.o -march=native -O3 -fPIC --std=c++0x
core/moods_scan.cpp:97:14: warning: unused variable 'done' [-Wunused-variable]
        bool done = 0;
             ^
core/moods_scan.cpp:252:33: warning: '&' within '|' [-Wbitwise-op-parentheses]
                    CODE = MASK & (CODE << SHIFT) | alphabet_map[seq[i+j+q-1]];
                           ~~~~~^~~~~~~~~~~~~~~~~ ~
core/moods_scan.cpp:252:33: note: place parentheses around the '&' expression to silence this warning
                    CODE = MASK & (CODE << SHIFT) | alphabet_map[seq[i+j+q-1]];
                                ^
                           (                     )
2 warnings generated.
core/moods_scan.cpp:97:14: warning: unused variable 'done' [-Wunused-variable]
        bool done = 0;
             ^
core/moods_scan.cpp:252:33: warning: '&' within '|' [-Wbitwise-op-parentheses]
                    CODE = MASK & (CODE << SHIFT) | alphabet_map[seq[i+j+q-1]];
                           ~~~~~^~~~~~~~~~~~~~~~~ ~
core/moods_scan.cpp:252:33: note: place parentheses around the '&' expression to silence this warning
                    CODE = MASK & (CODE << SHIFT) | alphabet_map[seq[i+j+q-1]];
                                ^
                           (                     )
2 warnings generated.
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/motif_0.cpp -o build/temp.macosx-10.6-intel-2.7/core/motif_0.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/motif_h.cpp -o build/temp.macosx-10.6-intel-2.7/core/motif_h.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/moods_misc.cpp -o build/temp.macosx-10.6-intel-2.7/core/moods_misc.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/scanner.cpp -o build/temp.macosx-10.6-intel-2.7/core/scanner.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/moods_tools.cpp -o build/temp.macosx-10.6-intel-2.7/core/moods_tools.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/match_types.cpp -o build/temp.macosx-10.6-intel-2.7/core/match_types.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang++ -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/core/scan_wrap.o build/temp.macosx-10.6-intel-2.7/core/moods_scan.o build/temp.macosx-10.6-intel-2.7/core/motif_0.o build/temp.macosx-10.6-intel-2.7/core/motif_h.o build/temp.macosx-10.6-intel-2.7/core/moods_misc.o build/temp.macosx-10.6-intel-2.7/core/scanner.o build/temp.macosx-10.6-intel-2.7/core/moods_tools.o build/temp.macosx-10.6-intel-2.7/core/match_types.o -o build/lib.macosx-10.6-intel-2.7/MOODS/_scan.so
building 'MOODS._parsers' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/parsers_wrap.cxx -o build/temp.macosx-10.6-intel-2.7/core/parsers_wrap.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/moods_parsers.cpp -o build/temp.macosx-10.6-intel-2.7/core/moods_parsers.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/moods_misc.cpp -o build/temp.macosx-10.6-intel-2.7/core/moods_misc.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/moods_tools.cpp -o build/temp.macosx-10.6-intel-2.7/core/moods_tools.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/match_types.cpp -o build/temp.macosx-10.6-intel-2.7/core/match_types.o -march=native -O3 -fPIC --std=c++0x
/usr/bin/clang++ -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/core/parsers_wrap.o build/temp.macosx-10.6-intel-2.7/core/moods_parsers.o build/temp.macosx-10.6-intel-2.7/core/moods_misc.o build/temp.macosx-10.6-intel-2.7/core/moods_tools.o build/temp.macosx-10.6-intel-2.7/core/match_types.o -o build/lib.macosx-10.6-intel-2.7/MOODS/_parsers.so
running install_lib
creating /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MOODS
copying build/lib.macosx-10.6-intel-2.7/MOODS/__init__.py -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MOODS
copying build/lib.macosx-10.6-intel-2.7/MOODS/_parsers.so -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MOODS
copying build/lib.macosx-10.6-intel-2.7/MOODS/_scan.so -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MOODS
copying build/lib.macosx-10.6-intel-2.7/MOODS/_tools.so -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MOODS
copying build/lib.macosx-10.6-intel-2.7/MOODS/misc.py -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MOODS
copying build/lib.macosx-10.6-intel-2.7/MOODS/parsers.py -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MOODS
copying build/lib.macosx-10.6-intel-2.7/MOODS/scan.py -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MOODS
copying build/lib.macosx-10.6-intel-2.7/MOODS/tools.py -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MOODS
byte-compiling /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MOODS/__init__.py to __init__.pyc
byte-compiling /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MOODS/misc.py to misc.pyc
byte-compiling /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MOODS/parsers.py to parsers.pyc
byte-compiling /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MOODS/scan.py to scan.pyc
byte-compiling /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MOODS/tools.py to tools.pyc
running install_egg_info
Writing /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MOODS_python-1.9.2-py2.7.egg-info

@jhkorhonen feel free to close the issue.

Thanks for MOODS!

jhkorhonen commented 8 years ago

Interesting. I am also running El Capitan, and I have not had this issue.

It might be related to using -std=c++11 vs -std=c++0x in compiler options in setup.py, but I will have to investigate this more – if this is the reason, I understand why it doesn't work for you, but I don't understand why it works for me...

rmovva commented 8 years ago

I did export MACOSX_DEPLOYMENT_TARGET=10.10 but now I am receiving the following error message: Rajivs-MacBook-Pro:MOODS-python-1.9.2 Rajiv$ python setup.py install running install running build running build_py running build_ext building 'MOODS._scan' extension /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icore/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c core/scan_wrap.cxx -o build/temp.macosx-10.6-intel-2.7/core/scan_wrap.o -march=native -O3 -fPIC --std=c++0x fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't create temporary output file: build/temp.macosx-10.6-intel-2.7/core/scan_wrap.o.lipo (Permission denied) clang: error: lipo command failed with exit code 1 (use -v to see invocation) error: command '/usr/bin/clang' failed with exit status 1

Any ideas?

jorgeboucas commented 8 years ago

I am on OS 10.11.6 ..

You can try to make sure you've the latest version of


Last login: Fri Jul 22 13:41:21 on ttys003
jboucas-mbpr:~ jboucas$ clang --version
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
jboucas-mbpr:~ jboucas$ clang++ --version
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
jboucas-mbpr:~ jboucas$ llvm-g++ --version
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
jboucas-mbpr:~ jboucas$ llvm-gcc --version
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
jhkorhonen commented 8 years ago

Sorry for the inactivity on this.

I think rmovva's issue is unrelated to the original problem, lipo just seems to be picky when writing temporary build files if something exists in the build/ directory already. Doing rm -rf build/ should fix it.

jhkorhonen commented 7 years ago

This should now (finally) be fixed in 1.9.3. Install script uses -std=c++11 instead of -std=c++0x, and this seems to work for me both on macOS 10.11 and 10.12.

fruce-ki commented 7 years ago

Hello,

I just encountered the same error installing MOODs 1.9.3 on a mac OSX Sierra 10.12.5: core/moods.h:8:10: fatal error: 'cstdint' file not found

The export MACOSX_DEPLOYMENT_TARGET=10.10 workaround worked, but I wouldn't call that a solution.

jhkorhonen commented 7 years ago

I'm still not sure what causes this, especially as I have not been able to reproduce this myself.

Could you dump the full log from the install script and also let me know what g++ --version says? What python are you running, i.e. Apple's built-in one or something else?

fruce-ki commented 7 years ago

Hi, I'd love to, but I have since sanitised both my python and gcc. This all was in the middle of me trying to install something else and having a variety of dependency issues, including gcc and python. I needed to get the stuff installed before a workshop, so preserving forensic evidence was not my priority while frantically trying to get everything to work.

These are my best guesses: GCC: probably the default osx alias to clang (version below). Either that, or the latest gcc on that day, compiled from source. I don't remember if I installed gcc as a result of this error or because it was a dependency for other things I needed. Python: At the time there were probably 4 python installations, two of them kinda broken. Not sure which was used. Probably the osx supplied ones (2.6.6, although there is also a 2.7.3).

I suppose I could try to see if it installs now on the sanitised system... If I can find it and remove it first.

This is my clang:

Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin