flatironinstitute / ManifoldEM

Python package for determination of conformational continua of macromolecules from single-particle cryo-EM data
GNU General Public License v3.0
7 stars 1 forks source link

failed building wheel for mayavi #12

Closed cruzchue closed 1 year ago

cruzchue commented 1 year ago

I am still trying to do a clean installation, now I got an error message that halts the process. It is a problem regarding mayavi. After the command

I got the following error:

  INFO:
  ########### EXT COMPILER OPTIMIZATION ###########
  INFO: Platform      :
    Architecture: x64
    Compiler    : clang

  CPU baseline  :
    Requested   : 'min'
    Enabled     : SSE SSE2 SSE3
    Flags       : -msse -msse2 -msse3
    Extra checks: none

  CPU dispatch  :
    Requested   : 'max -xop -fma4'
    Enabled     : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_KNL AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL
    Generated   : none
   INFO: CCompilerOpt.cache_flush[857] : write cache to path -> /private/var/folders/z0/3njsvxtx3ns1b9pdvc6jn40c0000gq/T/pip-install-a0y9n20w/mayavi_cc98faf7fb2041e4bd2d60ebdd546fa5/build/temp.macosx-10.9-x86_64-cpython-311/ccompiler_opt_cache_ext.py
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mayavi
Successfully built ManifoldEM
Failed to build fasthog mayavi
ERROR: Could not build wheels for fasthog, mayavi, which is required to install pyproject.toml-based projects

I also tried in a linux computer and got a very similar message (see below). Any advice?

  ########### EXT COMPILER OPTIMIZATION ###########
  INFO: Platform      :
    Architecture: x64
    Compiler    : gcc

  CPU baseline  :
    Requested   : 'min'
    Enabled     : SSE SSE2 SSE3
    Flags       : -msse -msse2 -msse3
    Extra checks: none

  CPU dispatch  :
    Requested   : 'max -xop -fma4'
    Enabled     : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2
    Generated   : none
  INFO: CCompilerOpt.cache_flush[857] : write cache to path -> /tmp/pip-install-6866dhoi/mayavi_5632f4cf955c4b7b85529260c6707ef6/build/temp.linux-x86_64-cpython-311/ccompiler_opt_cache_ext.py
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mayavi
Successfully built ManifoldEM
Failed to build fasthog mayavi
ERROR: Could not build wheels for fasthog, mayavi, which is required to install pyproject.toml-based projects
blackwer commented 1 year ago

Mac isn't supported currently. My fasthog library was written specifically for x86_64 processors, though I'll write a fallback for arm processors. There's also a couple of dirty hacks to disable mayavi when it doesn't detect proper 3d acceleration that won't work on macs as written. If you need this both fixes should be fairly straightforward, but linux is the current developer target.

I'm (very) surprised fasthog didn't build on linux. What distribution are you using? Do you have gcc and cmake installed? Those should be the only requirements. It looks like you're running on python3.11. I think Mayavi only works up to python3.10, which is probably the problem there. You should also probably prefix with a pip install --upgrade pip in your virtual environment to make sure that pyproject.toml projects are fully supported. I've updated the README to reflect this.

Can you try: pip install --verbose "fasthog@git+https://github.com/blackwer/fasthog@v0.1.5#egg=fasthog"

Edit: I added multi-arch support to fasthog and disabled the gl checks on non-linux operating systems. In theory this should run on mac now -- I've confirmed that it at least launches :). I'm also just going to make a conda package to avoid any build dependency issues popping up. That will take a bit so we should continue diagnosing this here. My install instructions have worked on every machine I've tested.

cruzchue commented 1 year ago

I was able to install ManifoldEM in an iMac17,1 following the updated conda instructions. Thanks!

Nevertheless, I am still not able to install ManifoldEM in our linux server with CentOS 7.9.2009. We do have gcc and cmake installed in that server. Below I attach final parts of the log file:

Building wheels for collected packages: fasthog
Running command git rev-parse HEAD
051ac30da4ddf2755c9dcc31ada094f3696f7796
Running command Building wheel for fasthog (pyproject.toml)

Trying 'Ninja' generator

CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.

Not searching for unused variables given on the command line.

 The C compiler identification is GNU 13.2.0
 Detecting C compiler ABI info
 Detecting C compiler ABI info - done
 Check for working C compiler: /home/cruzchu/00_Programs/01_anaconda/anaconda2/envs/flatironManifolEM/bin/cc - skipped
 Detecting C compile features
 Detecting C compile features - done
 The CXX compiler identification is GNU 4.8.5
 Detecting CXX compiler ABI info
 Detecting CXX compiler ABI info - done
 Check for working CXX compiler: /usr/bin/c++ - skipped
 Detecting CXX compile features
 Detecting CXX compile features - done
 Configuring done (1.1s)
 Generating done (0.0s)
 Build files have been written to: /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/_cmake_test_compile/build

Trying 'Ninja' generator - success

Configuring Project
Working directory:
  /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/_skbuild/linux-x86_64-3.12/cmake-build
Command:
  /tmp/pip-build-env-puzt_llt/overlay/lib/python3.12/site-packages/cmake/data/bin/cmake /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec -G Ninja -DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-puzt_llt/overlay/lib/python3.12/site-packages/ninja/data/bin/ninja --no-warn-unused-cli -DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/_skbuild/linux-x86_64-3.12/cmake-install -DPYTHON_VERSION_STRING:STRING=3.12.0 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/tmp/pip-build-env-puzt_llt/overlay/lib/python3.12/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/home/cruzchu/00_Programs/01_anaconda/anaconda2/envs/flatironManifolEM/bin/python -DPYTHON_INCLUDE_DIR:PATH=/home/cruzchu/00_Programs/01_anaconda/anaconda2/envs/flatironManifolEM/include/python3.12 -DPYTHON_LIBRARY:PATH=/home/cruzchu/00_Programs/01_anaconda/anaconda2/envs/flatironManifolEM/lib/libpython3.12.so -DPython_EXECUTABLE:PATH=/home/cruzchu/00_Programs/01_anaconda/anaconda2/envs/flatironManifolEM/bin/python -DPython_ROOT_DIR:PATH=/home/cruzchu/00_Programs/01_anaconda/anaconda2/envs/flatironManifolEM -DPython_FIND_REGISTRY:STRING=NEVER -DPython_INCLUDE_DIR:PATH=/home/cruzchu/00_Programs/01_anaconda/anaconda2/envs/flatironManifolEM/include/python3.12 -DPython3_EXECUTABLE:PATH=/home/cruzchu/00_Programs/01_anaconda/anaconda2/envs/flatironManifolEM/bin/python -DPython3_ROOT_DIR:PATH=/home/cruzchu/00_Programs/01_anaconda/anaconda2/envs/flatironManifolEM -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_INCLUDE_DIR:PATH=/home/cruzchu/00_Programs/01_anaconda/anaconda2/envs/flatironManifolEM/include/python3.12 -DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-puzt_llt/overlay/lib/python3.12/site-packages/ninja/data/bin/ninja -DCMAKE_BUILD_TYPE=Release

CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.

 Not searching for unused variables given on the command line.

 Not searching for unused variables given on the command line.

 The CXX compiler identification is GNU 4.8.5
 Detecting CXX compiler ABI info
 Detecting CXX compiler ABI info - done
 Check for working CXX compiler: /usr/bin/c++ - skipped
 Detecting CXX compile features
 Detecting CXX compile features - done
 Configuring done (0.6s)
 Generating done (0.0s)
 Build files have been written to: /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/_skbuild/linux-x86_64-3.12/cmake-build
[1/6] Building CXX object CMakeFiles/hog_avx512.dir/src/magnitude_orientation.cpp.o
FAILED: CMakeFiles/hog_avx512.dir/src/magnitude_orientation.cpp.o
/usr/bin/c++  -I/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/include -I/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern -O3 -DNDEBUG -std=gnu++1y -mavx512f -mfma -DVEC_T=Vec8d -MD -MT CMakeFiles/hog_avx512.dir/src/magnitude_orientation.cpp.o -MF CMakeFiles/hog_avx512.dir/src/magnitude_orientation.cpp.o.d -o CMakeFiles/hog_avx512.dir/src/magnitude_orientation.cpp.o -c /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/src/magnitude_orientation.cpp
c++: error: unrecognized command line option ‘-mavx512f’
[2/6] Building CXX object CMakeFiles/hog_sse4.dir/src/magnitude_orientation.cpp.o
FAILED: CMakeFiles/hog_sse4.dir/src/magnitude_orientation.cpp.o
/usr/bin/c++  -I/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/include -I/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern -O3 -DNDEBUG -std=gnu++1y -msse4 -DVEC_T=Vec2d -MD -MT CMakeFiles/hog_sse4.dir/src/magnitude_orientation.cpp.o -MF CMakeFiles/hog_sse4.dir/src/magnitude_orientation.cpp.o.d -o CMakeFiles/hog_sse4.dir/src/magnitude_orientation.cpp.o -c /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/src/magnitude_orientation.cpp
In file included from /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/vectorclass.h:38:0,
               from /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/src/magnitude_orientation.cpp:2:
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/instrset.h:33:2: error: #error Please compile for C++17 or higher
 #error Please compile for C++17 or higher
  ^
In file included from /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/vectorclass.h:38:0,
               from /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/src/magnitude_orientation.cpp:2:
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/instrset.h: In function ‘constexpr int bit_scan_reverse_const(uint64_t)’:
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/instrset.h:375:1: error: body of constexpr function ‘constexpr int bit_scan_reverse_const(uint64_t)’ not a return-statement
 }
 ^
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/instrset.h: In function ‘VTYPE nan_vec(uint32_t)’:
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/instrset.h:394:8: error: expected ‘(’ before ‘constexpr’
   if constexpr (VTYPE::elementtype() == 17) {  // double
      ^
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/src/magnitude_orientation.cpp:36:1: error: expected ‘}’ at end of input
 } // namespace fasthog
 ^
[3/6] Building CXX object CMakeFiles/hog_avx2.dir/src/magnitude_orientation.cpp.o
FAILED: CMakeFiles/hog_avx2.dir/src/magnitude_orientation.cpp.o
/usr/bin/c++  -I/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/include -I/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern -O3 -DNDEBUG -std=gnu++1y -mavx2 -mfma -DVEC_T=Vec4d -MD -MT CMakeFiles/hog_avx2.dir/src/magnitude_orientation.cpp.o -MF CMakeFiles/hog_avx2.dir/src/magnitude_orientation.cpp.o.d -o CMakeFiles/hog_avx2.dir/src/magnitude_orientation.cpp.o -c /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/src/magnitude_orientation.cpp
In file included from /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/vectorclass.h:38:0,
               from /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/src/magnitude_orientation.cpp:2:
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/instrset.h:33:2: error: #error Please compile for C++17 or higher
 #error Please compile for C++17 or higher
  ^
In file included from /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/vectorclass.h:55:0,
               from /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/src/magnitude_orientation.cpp:2:
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/vectorf256.h:2296:2: error: #error Compiler ABI version must be at least 4
 #error Compiler ABI version must be at least 4
^
In file included from /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/vectorclass.h:38:0,
               from /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/src/magnitude_orientation.cpp:2:
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/instrset.h: In function ‘constexpr int bit_scan_reverse_const(uint64_t)’:
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/instrset.h:375:1: error: body of constexpr function ‘constexpr int bit_scan_reverse_const(uint64_t)’ not a return-statement
 }
 ^
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/instrset.h: In function ‘VTYPE nan_vec(uint32_t)’:
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/instrset.h:394:8: error: expected ‘(’ before ‘constexpr’
   if constexpr (VTYPE::elementtype() == 17) {  // double
      ^
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/src/magnitude_orientation.cpp:36:1: error: expected ‘}’ at end of input
 } // namespace fasthog
 ^
[4/6] Building CXX object CMakeFiles/fasthog.dir/src/hog.cpp.o
FAILED: CMakeFiles/fasthog.dir/src/hog.cpp.o
/usr/bin/c++ -Dfasthog_EXPORTS -I/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/include -I/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern -O3 -DNDEBUG -std=gnu++1y -fPIC -MD -MT CMakeFiles/fasthog.dir/src/hog.cpp.o -MF CMakeFiles/fasthog.dir/src/hog.cpp.o.d -o CMakeFiles/fasthog.dir/src/hog.cpp.o -c /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/src/hog.cpp
In file included from /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/vectorclass.h:38:0,
                     from /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/src/hog.cpp:11:
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/instrset.h:33:2: error: #error Please compile for C++17 or higher
 #error Please compile for C++17 or higher
^
In file included from /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/vectorclass.h:38:0,
               from /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/src/hog.cpp:11:
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/instrset.h: In function ‘constexpr int bit_scan_reverse_const(uint64_t)’:
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/instrset.h:375:1: error: body of constexpr function ‘constexpr int bit_scan_reverse_const(uint64_t)’ not a return-statement
 }
 ^
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/instrset.h: In function ‘VTYPE nan_vec(uint32_t)’:
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/extern/afvec/instrset.h:394:8: error: expected ‘(’ before ‘constexpr’
   if constexpr (VTYPE::elementtype() == 17) {  // double
          ^
/tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/src/hog.cpp:300:1: error: expected ‘}’ at end of input
 }
 ^
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/tmp/pip-build-env-puzt_llt/overlay/lib/python3.12/site-packages/skbuild/setuptools_wrap.py", line 674, in setup
      cmkr.make(make_args, install_target=cmake_install_target, env=env)
  File "/tmp/pip-build-env-puzt_llt/overlay/lib/python3.12/site-packages/skbuild/cmaker.py", line 697, in make
      self.make_impl(clargs=clargs, config=config, source_dir=source_dir, install_target=install_target, env=env)
  File "/tmp/pip-build-env-puzt_llt/overlay/lib/python3.12/site-packages/skbuild/cmaker.py", line 742, in make_impl
  raise SKBuildError(msg)

An error occurred while building with CMake.
Command:
  /tmp/pip-build-env-puzt_llt/overlay/lib/python3.12/site-packages/cmake/data/bin/cmake --build . --target install --config Release --
Install target:
  install
Source directory:
  /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec
Working directory:
  /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec/_skbuild/linux-x86_64-3.12/cmake-build
Please check the install target is valid and see CMake's output for more information.

error: subprocess-exited-with-error

× Building wheel for fasthog (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /home/cruzchu/00_Programs/01_anaconda/anaconda2/envs/flatironManifolEM/bin/python /home/cruzchu/00_Programs/01_anaconda/anaconda2/envs/flatironManifolEM/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpypvij9wk
cwd: /tmp/pip-install-2677x_xc/fasthog_74ba7950b83240a486d15bf8dfdc92ec
Building wheel for fasthog (pyproject.toml) ... error
ERROR: Failed building wheel for fasthog
Failed to build fasthog
ERROR: Could not build wheels for fasthog, which is required to install pyproject.toml-based projects
blackwer commented 1 year ago
 Detecting C compiler ABI info
 Detecting C compiler ABI info - done
 Check for working C compiler: /home/cruzchu/00_Programs/01_anaconda/anaconda2/envs/flatironManifolEM/bin/cc - skipped
 Detecting C compile features
 Detecting C compile features - done
 The CXX compiler identification is GNU 4.8.5

Ahh. It looks like cmake isn't identifying the right g++ -- it's trying to use the system one rather than the conda version, and it's so old that it doesn't support the C++ feature set I need.

conda install -c conda-forge cxx-compiler

should "do the right thing". If you have a file quota on your home partition we should consider a different method down the road though :)

cruzchue commented 1 year ago

the last command did the work. Just completed the installation. Thanks!

blackwer commented 1 year ago

Just FYI. I'm building python wheels for fasthog now so you shouldn't need build tools to install ManifoldEM anymore. If your version of python supports mayavi and qt5, you should be golden from here on with any updates.