neuronsimulator / nrn

NEURON Simulator
http://nrn.readthedocs.io
Other
403 stars 119 forks source link

Issue while building with oneAPI intel compilers on MacOS #1837

Open pramodk opened 2 years ago

pramodk commented 2 years ago

Context

A user has reported various build issues while building nrn+coreneuron on MacOS using oneAPI compilers.

Overview of the issue

Here is the summary sent via email

Step I / Email I

slmp@SLMBP-2 ~ % mpichversion 
MPICH Version:      4.0.2
MPICH Release date: Thu Apr  7 12:34:45 CDT 2022
MPICH Device:       ch4:ofi
MPICH configure:    --prefix=/Volumes/CompTools/Compiled/IOA202160CL1316/mpich402 --enable-fortran=all
MPICH CC:   icc -std=gnu99 -clang-name=clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=12.3  -fno-common  -O2
MPICH CXX:  icpc -clangxx-name=clang++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=12.3 
MPICH F77:  ifort -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk 
MPICH FC:   ifort -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk 
MPICH Custom Information: 
slmp@SLMBP-2 build % cmake .. -DCMAKE_BUILD_TYPE=Custom -DCMAKE_C_COMPILER=icc -DCMAKE_C_FLAGS='-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -clang-name=clang -O3 -xHost -pthread' -DCMAKE_CXX_COMPILER=icpc -DCMAKE_CXX_FLAGS='-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -clangxx-name=clang++ -O3 -xHost -pthread' -DPYTHON_EXECUTABLE:PATH=`which python3` -DCMAKE_INSTALL_PREFIX=/Volumes/CompTools/Compiled/IOA202160CL1316/nrn82core_mpich402 -DNRN_ENABLE_INTERVIEWS=OFF -DNRN_ENABLE_MPI=ON -DNRN_ENABLE_PYTHON=ON -DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_RX3D:BOOL=OFF -DNRN_NMODL_CXX_FLAGS='-O3 -xHost' -DCORENRN_ENABLE_OPENMP=ON -DCORENRN_ENABLE_MPI=ON  

Unfortunately, make install gives this error:

ipo: warning #11013: can not find -framework /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
ld: warning: dylib (/Volumes/CompTools/Compiled/IOA202160CL1316/mpich402/lib/libmpi.dylib) was built for newer macOS version (12.3) than being linked (10.16)
ld: warning: dylib (/Volumes/CompTools/Compiled/IOA202160CL1316/mpich402/lib/libpmpi.dylib) was built for newer macOS version (12.3) than being linked (10.16)
 => LINKING executable ./special LDFLAGS are:     /Volumes/CompTools/opt/intel/oneapi/intelpython/latest/lib/libpython3.9.dylib -Wl,-rpath,/Volumes/CompTools/opt/intel/oneapi/intelpython/latest/lib /Volumes/CompTools/Compiled/IOA202160CL1316/mpich402/lib/libmpi.dylib -Wl,-rpath,/Volumes/CompTools/Compiled/IOA202160CL1316/mpich402/lib /Volumes/CompTools/Compiled/IOA202160CL1316/mpich402/lib/libpmpi.dylib -Wl,-rpath,/Volumes/CompTools/Compiled/IOA202160CL1316/mpich402/lib
ld: warning: dylib (/Volumes/CompTools/Compiled/IOA202160CL1316/mpich402/lib/libmpi.dylib) was built for newer macOS version (12.3) than being linked (10.16)
ld: warning: dylib (/Volumes/CompTools/Compiled/IOA202160CL1316/mpich402/lib/libpmpi.dylib) was built for newer macOS version (12.3) than being linked (10.16)
Successfully created x86_64/special
NEURON -- VERSION 8.2.dev-49-g571ab16a+ master (571ab16a+) 2022-05-17
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
See http://neuron.yale.edu/neuron/credits

Additional mechanisms from files
 "cabpump.mod" "cachan1.mod" "camchan.mod" "capump.mod" "invlfire.mod" "khhchan.mod" "mcna.mod" "nacaex.mod" "nachan.mod" "release.mod"
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = '/Volumes/CompTools/Compiled/IOA202160CL1316/hdf51122_mpich402_deps/lib/python3.9/site-packages:/Volumes/CompTools/Compiled/IOA202160CL1316/mpich402_deps/lib/python3.9/site-packages:/Volumes/CompTools/opt/intel/oneapi/advisor/2022.1.0/Intel Advisor [2022.1.app/Contents/pythonapi](http://2022.1.app/Contents/pythonapi)'
  program name = 'python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/Volumes/CompTools/Compiled/IOA202160CL1316/nrn82core_mpich402/bin/nrniv'
  sys.base_prefix = '/Volumes/localdisk/tools/tc/agent2/work/56d3ce06345d4f8e/base/conda-bld/python_1646222006778/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place'
  sys.base_exec_prefix = '/Volumes/localdisk/tools/tc/agent2/work/56d3ce06345d4f8e/base/conda-bld/python_1646222006778/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place'
  sys.platlibdir = 'lib'
  sys.executable = '/Volumes/CompTools/Compiled/IOA202160CL1316/nrn82core_mpich402/bin/nrniv'
  sys.prefix = '/Volumes/localdisk/tools/tc/agent2/work/56d3ce06345d4f8e/base/conda-bld/python_1646222006778/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place'
  sys.exec_prefix = '/Volumes/localdisk/tools/tc/agent2/work/56d3ce06345d4f8e/base/conda-bld/python_1646222006778/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place'
  sys.path = [
    '/Volumes/CompTools/Compiled/IOA202160CL1316/hdf51122_mpich402_deps/lib/python3.9/site-packages',
    '/Volumes/CompTools/Compiled/IOA202160CL1316/mpich402_deps/lib/python3.9/site-packages',
    '/Volumes/CompTools/opt/intel/oneapi/advisor/2022.1.0/Intel Advisor [2022.1.app/Contents/pythonapi](http://2022.1.app/Contents/pythonapi)',
    '/Volumes/localdisk/tools/tc/agent2/work/56d3ce06345d4f8e/base/conda-bld/python_1646222006778/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/python39.zip',
    '/Volumes/localdisk/tools/tc/agent2/work/56d3ce06345d4f8e/base/conda-bld/python_1646222006778/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/python3.9',
    '/Volumes/localdisk/tools/tc/agent2/work/56d3ce06345d4f8e/base/conda-bld/python_1646222006778/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x0000000110744600 (most recent call first):
<no Python frame>

which crashes upon python import.

Step II / Email II

I saw https://github.com/neuronsimulator/nrn/issues/618. By setting PYTHONHOME, I overcame the make install error icw 'encodings'. However, I get segmentation fault.

cmake .. -DCMAKE_C_COMPILER=icc -DCMAKE_C_FLAGS='-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -clang-name=clang' -DCMAKE_CXX_COMPILER=icpc -DCMAKE_CXX_FLAGS='-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -clangxx-name=clang++' -DPYTHON_EXECUTABLE:PATH=`which python3` -DCMAKE_INSTALL_PREFIX=/Volumes/CompTools/Compiled/IOA202160CL1316/nrn82core_mpich402 -DNRN_ENABLE_INTERVIEWS=OFF -DNRN_ENABLE_MPI=ON -DNRN_ENABLE_PYTHON=ON -DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_RX3D:BOOL=OFF -DCORENRN_ENABLE_OPENMP=ON -DCORENRN_ENABLE_MPI=ON

>>> import faulthandler
>>> faulthandler.enable()
>>> import neuron
Fatal Python error: Segmentation fault

Current thread 0x0000000118c23600 (most recent call first):
  File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 1173 in create_module
  File "<frozen importlib._bootstrap>", line 565 in module_from_spec
  File "<frozen importlib._bootstrap>", line 666 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
  File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1058 in _handle_fromlist
  File "/Volumes/CompTools/Compiled/IOA202160CL1316/nrn82core_mpich402/lib/python/neuron/__init__.py", line 135 in <module>
  File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 850 in exec_module
  File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
  File "<stdin>", line 1 in <module>
zsh: segmentation fault  python3

Another trial by setting the DEPLOYMENT_TARGET=12.3

slmp@DN2m1i9v9 build % cmake .. -DCMAKE_C_COMPILER=icc -DCMAKE_C_FLAGS='-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -clang-name=clang' -DCMAKE_CXX_COMPILER=icpc -DCMAKE_CXX_FLAGS='-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -clangxx-name=clang++' -DPYTHON_EXECUTABLE:PATH=`which python3` -DCMAKE_INSTALL_PREFIX=/Volumes/CompTools/Compiled/IOA202160CL1316/nrn82core_mpich402 -DNRN_ENABLE_INTERVIEWS=OFF -DNRN_ENABLE_MPI=ON -DNRN_ENABLE_PYTHON=ON -DNRN_ENABLE_CORENEURON=OFF -DNRN_ENABLE_RX3D:BOOL=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET=12.3

[ 98%] Linking CXX shared library ../../lib/libnrniv.dylib
ipo: warning #11109: unable to find -lc++ in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libc++.tbd
ipo: warning #11109: unable to find -lc++ in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libc++.tbd
ipo: warning #11109: unable to find -lc++ in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libc++.tbd
ipo: warning #11109: unable to find -lc++ in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libc++.tbd
ipo: warning #11109: unable to find -lc++ in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libc++.tbd
ipo: warning #11109: unable to find -lc++ in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libc++.tbd
ipo: warning #11109: unable to find -lc++ in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libc++.tbd
ipo: warning #11109: unable to find -lc++ in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libc++.tbd
ipo: warning #11109: unable to find -lSystem in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd
ipo: warning #11109: unable to find -lSystem in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd
ipo: warning #11109: unable to find -lSystem in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd
ipo: warning #11109: unable to find -lSystem in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd
ipo: warning #11013: can not find -framework /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
ipo: warning #11013: can not find -framework /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
ld: warning: pointer not aligned at address 0x4C0C55 (anon + 48 from CMakeFiles/nrniv_lib.dir/__/ivoc/htlist.cpp.o)
ld: warning: pointer not aligned at address 0x4C0C65 (anon + 64 from CMakeFiles/nrniv_lib.dir/__/ivoc/htlist.cpp.o)
ld: warning: pointer not aligned at address 0x4C0C75 (anon + 80 from CMakeFiles/nrniv_lib.dir/__/ivoc/htlist.cpp.o)

.....

ld: warning: pointer not aligned at address 0x548A6B (anon + 48 from CMakeFiles/nrniv_lib.dir/__/ivos/resource.cpp.o)
ld: warning: pointer not aligned at address 0x548A7B (anon + 64 from CMakeFiles/nrniv_lib.dir/__/ivos/resource.cpp.o)
ld: warning: pointer not aligned at address 0x548A8B (anon + 80 from CMakeFiles/nrniv_lib.dir/__/ivos/resource.cpp.o)
ld: unaligned pointer(s) for architecture x86_64
make[2]: *** [lib/libnrniv.dylib] Error 1
make[1]: *** [src/nrniv/CMakeFiles/nrniv_lib.dir/all] Error 2
make: *** [all] Error 2

Expected result/behavior

NRN+CoreNRN should be able to build cleanly on MacOS with OneAPI toolchain

NEURON setup

Minimal working example - MWE

pramodk commented 2 years ago

My fresh build on Mac:


source /opt/intel/oneapi/setvars.sh
cmake .. -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DNRN_ENABLE_INTERVIEWS=OFF -DNRN_ENABLE_MPI=ON -DNRN_ENABLE_PYTHON=ON -DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_RX3D:BOOL=OFF -DCORENRN_ENABLE_OPENMP=ON -DCORENRN_ENABLE_MPI=ON -DCMAKE_INSTALL_PREFIX=`pwd`/install

  build_intel git:(master) ✗ cmake .. -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DNRN_ENABLE_INTERVIEWS=OFF -DNRN_ENABLE_MPI=ON -DNRN_ENABLE_PYTHON=ON -DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_RX3D:BOOL=OFF -DCORENRN_ENABLE_OPENMP=ON -DCORENRN_ENABLE_MPI=ON -DCMAKE_INSTALL_PREFIX=`pwd`/install
-- The C compiler identification is Intel 2021.6.0.20220226
-- The CXX compiler identification is Intel 2021.6.0.20220226
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/intel/oneapi/compiler/2022.1.0/mac/bin/intel64/icc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/intel/oneapi/compiler/2022.1.0/mac/bin/intel64/icpc - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'RelWithDebInfo' as none was specified.
-- 3rd party project: using Random123 from "external/Random123"
-- Found BISON: /usr/local/opt/bison/bin/bison (found version "3.8.2")
-- Found FLEX: /usr/local/opt/flex/bin/flex (found version "2.6.4")
-- Found Readline: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include
-- Found MPI_C: /usr/local/Cellar/open-mpi/4.1.2/lib/libmpi.dylib (found version "3.1")
-- Found MPI_CXX: /usr/local/Cellar/open-mpi/4.1.2/lib/libmpi.dylib (found version "3.1")
-- Found MPI: TRUE (found version "3.1")
-- Detected OpenMPI 4.1.2
-- -DPYTHON_EXECUTABLE not specified. Looking for `python3` in the PATH exclusively...
--  Setting PYTHON_EXECUTABLE=/opt/intel/oneapi/intelpython/latest/bin/python3
-- Found PythonInterp: /opt/intel/oneapi/intelpython/latest/bin/python3 (found suitable version "3.9.10", minimum required is "3.7")
-- Found PythonInterp: /opt/intel/oneapi/intelpython/latest/bin/python3 (found suitable version "3.9.10", minimum required is "3")
-- Found PythonLibs: /opt/intel/oneapi/intelpython/latest/lib/libpython3.9.dylib
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Building CoreNEURON from submodule
-- Sub-project : using coreneuron from from /Users/kumbhar/workarena/repos/bbp/nrn/external/coreneuron
-- Found HpcCodingConv: /Users/kumbhar/workarena/repos/bbp/nrn/external/coreneuron/CMake/hpc-coding-conventions
-- CORENRN_FORMATTING: OFF
-- CORENRN_TEST_FORMATTING: OFF
-- CORENRN_CLANG_FORMAT: OFF
-- CORENRN_CMAKE_FORMAT: OFF
-- CORENRN_GIT_HOOKS: OFF
-- CORENRN_GIT_COMMIT_HOOKS:
-- CORENRN_GIT_PUSH_HOOKS: courtesy-msg
-- CORENRN_STATIC_ANALYSIS: OFF
-- CORENRN_TEST_STATIC_ANALYSIS: OFF
-- Found Random123: /Users/kumbhar/workarena/repos/bbp/nrn/external/coreneuron/external/Random123
-- Found CLI11: /Users/kumbhar/workarena/repos/bbp/nrn/external/coreneuron/external/CLI11
-- Found Git: /usr/bin/git (found version "2.32.0 (Apple Git-132)")
-- Found Doxygen: /usr/local/bin/doxygen (found version "1.9.3") found components: doxygen missing components: dot

-- Found PythonInterp: /opt/intel/oneapi/intelpython/latest/bin/python3 (found version "3.9.10")
-- Found Perl: /usr/bin/perl (found version "5.30.3")
-- Found MOD2C: /Users/kumbhar/workarena/repos/bbp/nrn/external/coreneuron/external/mod2c
-- Using mod2c submodule from /Users/kumbhar/workarena/repos/bbp/nrn/external/coreneuron/external/mod2c
-- mod2c is used as APPLICATION_NAME
--
-- Configured CoreNEURON 8.2.0
--
-- You can now build CoreNEURON using:
--   cmake --build . --parallel 8 [--target TARGET]
-- You might want to adjust the number of parallel build jobs for your system.
-- Some non-default targets you might want to build:
-- --------------------+--------------------------------------------------------
--  Target             |   Description
-- --------------------+--------------------------------------------------------
-- install             | Will install CoreNEURON to: /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install
-- docs                | Build full docs. Calls targets: doxygen, sphinx
-- --------------------+--------------------------------------------------------
--  Build option       | Status
-- --------------------+--------------------------------------------------------
-- CXX COMPILER        | /opt/intel/oneapi/compiler/2022.1.0/mac/bin/intel64/icpc
-- COMPILE FLAGS       |  -qopenmp  -Wno-unknown-pragmas -g  -O2  -std=c++14
-- Build Type          | SHARED
-- MPI                 | ON
--   DYNAMIC           | OFF
--   INC               | /usr/local/Cellar/open-mpi/4.1.2/include
-- OpenMP              | ON
-- Use legacy units    | OFF
-- NMODL               | OFF
-- MOD2CPP PATH        | /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/bin/mod2c_core
-- GPU Support         | OFF
-- Auto Timeout        | ON
-- Wrap exp()          | OFF
-- SplayTree Queue     | ON
-- NetReceive Buffer   | ON
-- Caliper             | OFF
-- Likwid              | OFF
-- Unit Tests          | OFF
-- Reporting           | OFF
-- --------------+--------------------------------------------------------------
--  See documentation : https://github.com/BlueBrain/CoreNeuron/
-- --------------+--------------------------------------------------------------
--
Extracting link flags from target 'Threads::Threads', beware that this can be fragile. Got:
Generating link flags from path /opt/intel/oneapi/intelpython/latest/lib/libpython3.9.dylib Got: /opt/intel/oneapi/intelpython/latest/lib/libpython3.9.dylib -Wl,-rpath,/opt/intel/oneapi/intelpython/latest/lib
Generating link flags from path /usr/local/Cellar/open-mpi/4.1.2/lib/libmpi.dylib Got: /usr/local/Cellar/open-mpi/4.1.2/lib/libmpi.dylib -Wl,-rpath,/usr/local/Cellar/open-mpi/4.1.2/lib
--
-- Configured NEURON 8.2.0
--
-- You can now build NEURON using:
--   cmake --build . --parallel 8 [--target TARGET]
-- You might want to adjust the number of parallel build jobs for your system.
-- Some non-default targets you might want to build:
-- --------------+--------------------------------------------------------------
--  Target       |   Description
-- --------------+--------------------------------------------------------------
-- install       | Will install NEURON to: /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install
--               | Change the install location of NEURON using:
--               |   cmake <src_path> -DCMAKE_INSTALL_PREFIX=<install_path>
-- docs          | Build full docs. Calls targets: doxygen, notebooks, sphinx, notebooks-clean
-- uninstall     | Removes files installed by make install (todo)
-- --------------+--------------------------------------------------------------
--  Build option | Status
-- --------------+--------------------------------------------------------------
-- C COMPILER    | /opt/intel/oneapi/compiler/2022.1.0/mac/bin/intel64/icc
-- CXX COMPILER  | /opt/intel/oneapi/compiler/2022.1.0/mac/bin/intel64/icpc
-- BUILD_TYPE    | RelWithDebInfo (allowed: Custom;Debug;Release;RelWithDebInfo;Fast)
-- COMPILE FLAGS | -g  -O2
-- Shared        | ON
-- Default units | modern units (2019 nist constants)
-- MPI           | ON
--   DYNAMIC     | OFF
--   INC         | /usr/local/Cellar/open-mpi/4.1.2/include
--   LIB         | /usr/local/Cellar/open-mpi/4.1.2/lib/libmpi.dylib
-- Python        | ON
--   EXE         | /opt/intel/oneapi/intelpython/latest/bin/python3
--   INC         | /opt/intel/oneapi/intelpython/latest/include/python3.9
--   LIB         | /opt/intel/oneapi/intelpython/latest/lib/libpython3.9.dylib
--   MODULE      | ON
--   DYNAMIC     | OFF
-- Readline      | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libreadline.tbd
-- Curses        | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libcurses.tbd;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libform.tbd
-- RX3D          | OFF
-- Interviews    | OFF
-- CoreNEURON    | ON
--   PATH        | /Users/kumbhar/workarena/repos/bbp/nrn/external/coreneuron
--   LINK FLAGS  | -Lx86_64 -lcorenrnmech
--   Legacy Units| OFF
-- Tests         | OFF
-- --------------+--------------------------------------------------------------
--  See documentation : https://www.neuron.yale.edu/neuron/
-- --------------+--------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/kumbhar/workarena/repos/bbp/nrn/build_intel

Able to build:

make -j4

But during install

...
-- Up-to-date: /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/include/cspmatrix.h
"install" of folder "build_intel" of folder "nrn" of folder "bbp" of folder "repos" of folder "workarena" of folder "kumbhar" of folder "Users"
folder bin of folder install of folder build_intel of folder nrn of folder bbp of folder repos of folder workarena of folder kumbhar of folder Users of startup disk
/usr/bin/xcrun
/Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/share/nrn/demo/release
Mod files: "./cabpump.mod" "./cachan1.mod" "./camchan.mod" "./capump.mod" "./invlfire.mod" "./khhchan.mod" "./mcna.mod" "./nacaex.mod" "./nachan.mod" "./release.mod"

Creating 'x86_64' directory for .o files.

 -> Compiling mod_func.cpp
 -> NMODL ../cabpump.mod
 -> NMODL ../cachan1.mod
 -> NMODL ../camchan.mod
Translating camchan.mod into /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/share/nrn/demo/release/x86_64/camchan.c
Translating cabpump.mod into /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/share/nrn/demo/release/x86_64/cabpump.c
Translating cachan1.mod into /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/share/nrn/demo/release/x86_64/cachan1.c
Thread Safe
Notice: Assignment to the GLOBAL variable, "vol", is not thread safe
Thread Safe
 -> NMODL ../capump.mod
 -> NMODL ../invlfire.mod
 -> NMODL ../khhchan.mod
Translating capump.mod into /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/share/nrn/demo/release/x86_64/capump.c
Translating invlfire.mod into /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/share/nrn/demo/release/x86_64/invlfire.c
Thread Safe
Thread Safe
Translating khhchan.mod into /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/share/nrn/demo/release/x86_64/khhchan.c
 -> NMODL ../mcna.mod
Thread Safe
 -> NMODL ../nacaex.mod
 -> NMODL ../nachan.mod
Translating mcna.mod into /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/share/nrn/demo/release/x86_64/mcna.c
Translating nacaex.mod into /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/share/nrn/demo/release/x86_64/nacaex.c
Thread Safe
Thread Safe
Translating nachan.mod into /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/share/nrn/demo/release/x86_64/nachan.c
 -> NMODL ../release.mod
 -> Compiling cabpump.c
Thread Safe
 -> Compiling cachan1.c
Translating release.mod into /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/share/nrn/demo/release/x86_64/release.c
Thread Safe
 -> Compiling camchan.c
 -> Compiling capump.c
 -> Compiling invlfire.c
 -> Compiling khhchan.c
 -> Compiling mcna.c
 -> Compiling nacaex.c
 -> Compiling nachan.c
 -> Compiling release.c
 => LINKING shared library ./libnrnmech.dylib
ld: warning: dylib (/usr/local/Cellar/open-mpi/4.1.2/lib/libmpi.dylib) was built for newer macOS version (11.0) than being linked (10.16)
 => LINKING executable ./special LDFLAGS are:     /opt/intel/oneapi/intelpython/latest/lib/libpython3.9.dylib -Wl,-rpath,/opt/intel/oneapi/intelpython/latest/lib /usr/local/Cellar/open-mpi/4.1.2/lib/libmpi.dylib -Wl,-rpath,/usr/local/Cellar/open-mpi/4.1.2/lib
ld: warning: dylib (/usr/local/Cellar/open-mpi/4.1.2/lib/libmpi.dylib) was built for newer macOS version (11.0) than being linked (10.16)
Successfully created x86_64/special
NEURON -- VERSION 8.2.dev-54-gfe112466a+ master (fe112466a+) 2022-05-25
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
See http://neuron.yale.edu/neuron/credits

Additional mechanisms from files
 "cabpump.mod" "cachan1.mod" "camchan.mod" "capump.mod" "invlfire.mod" "khhchan.mod" "mcna.mod" "nacaex.mod" "nachan.mod" "release.mod"
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv'
  sys.base_prefix = '/Volumes/localdisk/tools/tc/agent2/work/56d3ce06345d4f8e/base/conda-bld/python_1646222006778/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place'
  sys.base_exec_prefix = '/Volumes/localdisk/tools/tc/agent2/work/56d3ce06345d4f8e/base/conda-bld/python_1646222006778/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place'
  sys.platlibdir = 'lib'
  sys.executable = '/Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv'
  sys.prefix = '/Volumes/localdisk/tools/tc/agent2/work/56d3ce06345d4f8e/base/conda-bld/python_1646222006778/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place'
  sys.exec_prefix = '/Volumes/localdisk/tools/tc/agent2/work/56d3ce06345d4f8e/base/conda-bld/python_1646222006778/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place'
  sys.path = [
    '/Volumes/localdisk/tools/tc/agent2/work/56d3ce06345d4f8e/base/conda-bld/python_1646222006778/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/python39.zip',
    '/Volumes/localdisk/tools/tc/agent2/work/56d3ce06345d4f8e/base/conda-bld/python_1646222006778/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/python3.9',
    '/Volumes/localdisk/tools/tc/agent2/work/56d3ce06345d4f8e/base/conda-bld/python_1646222006778/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x0000000119105600 (most recent call first):
<no Python frame>

Setting PYTHONPATH

$ PYTHONHOME=/opt/intel/oneapi/intelpython/python3.9  make install
...
 -> Compiling nachan.c
 -> Compiling release.c
 => LINKING shared library ./libnrnmech.dylib
ld: warning: dylib (/usr/local/Cellar/open-mpi/4.1.2/lib/libmpi.dylib) was built for newer macOS version (11.0) than being linked (10.16)
 => LINKING executable ./special LDFLAGS are:     /opt/intel/oneapi/intelpython/latest/lib/libpython3.9.dylib -Wl,-rpath,/opt/intel/oneapi/intelpython/latest/lib /usr/local/Cellar/open-mpi/4.1.2/lib/libmpi.dylib -Wl,-rpath,/usr/local/Cellar/open-mpi/4.1.2/lib
ld: warning: dylib (/usr/local/Cellar/open-mpi/4.1.2/lib/libmpi.dylib) was built for newer macOS version (11.0) than being linked (10.16)
Successfully created x86_64/special
NEURON -- VERSION 8.2.dev-54-gfe112466a+ master (fe112466a+) 2022-05-25
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
See http://neuron.yale.edu/neuron/credits

Additional mechanisms from files
 "cabpump.mod" "cachan1.mod" "camchan.mod" "capump.mod" "invlfire.mod" "khhchan.mod" "mcna.mod" "nacaex.mod" "nachan.mod" "release.mod"

$ echo $?
0

Trying to do simple import:

$  build_intel git:(master) ✗ PYTHONHOME=/opt/intel/oneapi/intelpython/python3.9  PATH=`pwd`/install/bin:$PATH PYTHONPATH=`pwd`/install/lib/python/:$PYTHONPATH nrniv -python
NEURON -- VERSION 8.2.dev-54-gfe112466a+ master (fe112466a+) 2022-05-25
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
See http://neuron.yale.edu/neuron/credits

>>> from neuron import h
>>> import neuron
>>>

When we run tests

➜  build_intel git:(master) ✗ PYTHONHOME=/opt/intel/oneapi/intelpython/python3.9  PATH=`pwd`/install/bin:$PATH PYTHONPATH=`pwd`/install/lib/python/:$PYTHONPATH nrniv -python
NEURON -- VERSION 8.2.dev-54-gfe112466a+ master (fe112466a+) 2022-05-25
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
See http://neuron.yale.edu/neuron/credits

>>> import neuron; neuron.test()
testBytesize (neuron.tests.test_vector.VectorTestCase)
Test that Vector.__array_interface__ returns the proper bytesize (of a double) ... ok
testEndian (neuron.tests.test_vector.VectorTestCase)
Test that Vector.__array_interface__ returns the proper byteorder (endian) ... ok
testNumpyInteraction (neuron.tests.test_vector.VectorTestCase)
Testing numpy.array <=> hoc.Vector interaction ... ok
testPerformance (neuron.tests.test_vector.VectorTestCase)
Test performance of Vector<->list,array ...

Executed "l = range(1000000)".  Elapsed = 0.000020 s
Executed "v = h.Vector(l)".  Elapsed = 0.077634 s
inplace:
Executed "v.from_python(l)".  Elapsed = 0.076137 s
Executed "a = numpy.array(v)".  Elapsed = 0.001575 s
inplace:
Executed "v.to_python(a)".  Elapsed = 0.000898 s
Executed "v2 = h.Vector(a)".  Elapsed = 0.002758 s
inplace:
Executed "v2.from_python(a)".  Elapsed = 0.000986 s
Executed "l2 = list(v2)".  Elapsed = 0.031573 s
inplace:
Executed "v.to_python(l2)".  Elapsed = 0.007077 s
Executed "v2 = h.Vector(a[::-1])".  Elapsed = 0.001552 s
Executed "a2 = numpy.array(v2)".  Elapsed = 0.001326 s
ok
testABI (neuron.tests.test_neuron.NeuronTestCase)
Test use of some  Py_LIMITED_API for python3. ... ok
testExtendedSection (neuron.tests.test_neuron.NeuronTestCase) ... NEURON -- VERSION 8.2.dev-54-gfe112466a+ master (fe112466a+) 2022-05-25
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
See http://neuron.yale.edu/neuron/credits

NEURON -- VERSION 8.2.dev-54-gfe112466a+ master (fe112466a+) 2022-05-25
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
See http://neuron.yale.edu/neuron/credits

/Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv: syntax error
 near line 1
 from multiprocessing.resource_tracker import main;main(4)
                    ^
/Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv: arg not valid statement: from multiprocessing.resource_tracker import main;main(4)
 near line 0
 ^
/Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv: syntax error
 near line 1
 from multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=5, pipe_handle=7)
                    ^
/Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv: arg not valid statement: from multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=5, pipe_handle=7)
 near line 0
 ^
0 /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv: can't open --multiprocessing-fork
ok
testHClass (neuron.tests.test_neuron.NeuronTestCase)
Test subclass of hoc class. ... ok
testHelp (neuron.tests.test_neuron.NeuronTestCase) ... Syntax:
    .. code-block::
        python

        h.xpanel('name')
        h.xpanel('name', [0-1])
        h.xpanel()
        h.xpanel(x, y)
        h.xpanel(scroll)
        h.xpanel(scroll, x, y)

Description:

    ``h.xpanel("name")``

    ``h.xpanel("name", [0-1])``
        Title of a new panel. Every
        button, menu, and value between this and a closing ``xpanel()`` command
        with no arguments (or placement args) belongs to this panel.
        If the form is used with a second argument equal to 1, then
        the panel is laid out horizontally. Otherwise the default is vertically.

    ``h.xpanel()``

    ``h.xpanel(x, y)``
        done constructing the panel. so map it to the screen with position
        optionally specified.

    ``h.xpanel(scroll)``

    ``h.xpanel(scroll, x, y)``
        as above but if the first arg is a number, then the value determines
        whether the panel will be inside a scrollbox. Scroll = 0 means a scrollbox
        will NOT be used. Scroll = 1 means the panel will be inside a scrollbox.
        Scroll = -1 is the default value and whether or not a scrollbox is used
        is determined by the number of panel items in comparison with the
        value of the panel_scroll property in the nrn.defaults file.

ok
testIterators (neuron.tests.test_neuron.NeuronTestCase)
Test section, segment, mechanism, rangevar iterators. ... ok
testRxDexistence (neuron.tests.test_neuron.NeuronTestCase) ... writing to a broken pipe
/opt/intel/oneapi/intelpython/python3.9/lib/python3.9/multiprocessing/resource_tracker.py:96: UserWarning: resource_tracker: process died unexpectedly, relaunching.  Some resources might leak.
  warnings.warn('resource_tracker: process died unexpectedly, '
NEURON -- VERSION 8.2.dev-54-gfe112466a+ master (fe112466a+) 2022-05-25
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
See http://neuron.yale.edu/neuron/credits

NEURON -- VERSION 8.2.dev-54-gfe112466a+ master (fe112466a+) 2022-05-25
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
See http://neuron.yale.edu/neuron/credits

/Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv: syntax error
 near line 1
 from multiprocessing.resource_tracker import main;main(4)
                    ^
/Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv: arg not valid statement: from multiprocessing.resource_tracker import main;main(4)
 near line 0
 ^
/Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv: syntax error
 near line 1
 from multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=5, pipe_handle=7)
                    ^
/Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv: arg not valid statement: from multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=5, pipe_handle=7)
 near line 0
 ^
0 /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv: can't open --multiprocessing-fork
ok
testSectionArgOrder (neuron.tests.test_neuron.NeuronTestCase)
First optional arg for Section is name (but name="name" is recommended) ... ok
testSectionCell (neuron.tests.test_neuron.NeuronTestCase)
Section.cell() internally referenced as weakref. ... ok
testSectionListIterator (neuron.tests.test_neuron.NeuronTestCase)
As of v8.0, iteration over a SectionList does not change the cas ... ok
test_newobj_err (neuron.tests.test_neuron.NeuronTestCase)
Test deletion of incompletely constructed objects ...
nrniv: generate an error
 near line 1
 ob = new NewObj(1, 2)
                      ^
        NewObj[4].execerror("generate a...")
      NewObj[4].init(0, 2)
    NewObj[3].init(1, 2)
  NewObj[2].execute1("ob = new N...", NewObj[2])
and others
#NewObj and #Foo in existence 3 6
after del a #NewObj and #Foo in existence 0 0
ok
testpsection (neuron.tests.test_neuron.NeuronTestCase) ... writing to a broken pipe
NEURON -- VERSION 8.2.dev-54-gfe112466a+ master (fe112466a+) 2022-05-25
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
See http://neuron.yale.edu/neuron/credits

NEURON -- VERSION 8.2.dev-54-gfe112466a+ master (fe112466a+) 2022-05-25
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
See http://neuron.yale.edu/neuron/credits

/Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv: syntax error
 near line 1
 from multiprocessing.resource_tracker import main;main(4)
                    ^
/Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv: arg not valid statement: from multiprocessing.resource_tracker import main;main(4)
 near line 0
 ^
/Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv: syntax error
 near line 1
 from multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=5, pipe_handle=7)
                    ^
/Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv: arg not valid statement: from multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=5, pipe_handle=7)
 near line 0
 ^
0 /Users/kumbhar/workarena/repos/bbp/nrn/build_intel/install/bin/nrniv: can't open --multiprocessing-fork
ok

----------------------------------------------------------------------
Ran 15 tests in 1.473s

OK
True
>>>

But starting python3 gives segfault:

$  build_intel git:(master) ✗ PYTHONHOME=/opt/intel/oneapi/intelpython/python3.9  PATH=`pwd`/install/bin:$PATH PYTHONPATH=`pwd`/install/lib/python/:$PYTHONPATH python3
Python 3.9.10 (main, Mar  2 2022, 06:01:01)
[Clang 10.0.0 ] :: Intel Corporation on darwin
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
>>> import neuron
[1]    82555 segmentation fault  PYTHONHOME=/opt/intel/oneapi/intelpython/python3.9 PATH= PYTHONPATH= python3
pramodk commented 2 years ago

Using Non-Intel Python

The easiest "solution / workaround" still seems to be avoid Intel Python. Using system python (-DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.9/bin/python3, it seems to work:

$ cmake .. -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DNRN_ENABLE_INTERVIEWS=OFF -DNRN_ENABLE_MPI=ON -DNRN_ENABLE_PYTHON=ON -DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_RX3D:BOOL=ON -DCORENRN_ENABLE_OPENMP=ON -DCORENRN_ENABLE_MPI=ON -DCMAKE_INSTALL_PREFIX=`pwd`/install -DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
....
cmake .. -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DNRN_ENABLE_INTERVIEWS=OFF -DNRN_ENABLE_MPI=ON -DNRN_ENABLE_PYTHON=ON -DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_RX3D:BOOL=ON -DCORENRN_ENABLE_OPENMP=ON -DCORENRN_ENABLE_MPI=ON -DCMAKE_INSTALL_PREFIX=`pwd`/install -DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
-- 3rd party project: using Random123 from "external/Random123"
-- Found PythonInterp: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 (found version "3.9.10")
-- Detected OpenMPI 4.1.2
-- Found PythonInterp: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 (found suitable version "3.9.10", minimum required is "3.7")
-- Found PythonInterp: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 (found suitable version "3.9.10", minimum required is "3")
-- Found PythonLibs: /Library/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib
-- Building CoreNEURON from submodule
-- Sub-project : using coreneuron from from /Users/kumbhar/workarena/repos/bbp/nrn/external/coreneuron
-- CORENRN_FORMATTING: OFF
-- CORENRN_TEST_FORMATTING: OFF
-- CORENRN_CLANG_FORMAT: OFF
-- CORENRN_CMAKE_FORMAT: OFF
-- CORENRN_GIT_HOOKS: OFF
-- CORENRN_GIT_COMMIT_HOOKS:
-- CORENRN_GIT_PUSH_HOOKS: courtesy-msg
-- CORENRN_STATIC_ANALYSIS: OFF
-- CORENRN_TEST_STATIC_ANALYSIS: OFF

-- Found PythonInterp: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 (found version "3.9.10")
-- Using mod2c submodule from /Users/kumbhar/workarena/repos/bbp/nrn/external/coreneuron/external/mod2c
-- mod2c is used as APPLICATION_NAME
--
-- Configured CoreNEURON 8.2.0
--
-- You can now build CoreNEURON using:
--   cmake --build . --parallel 8 [--target TARGET]
-- You might want to adjust the number of parallel build jobs for your system.
-- Some non-default targets you might want to build:
-- --------------------+--------------------------------------------------------
--  Target             |   Description
-- --------------------+--------------------------------------------------------
-- install             | Will install CoreNEURON to: /Users/kumbhar/workarena/repos/bbp/nrn/build_intel_system_python/install
-- docs                | Build full docs. Calls targets: doxygen, sphinx
-- --------------------+--------------------------------------------------------
--  Build option       | Status
-- --------------------+--------------------------------------------------------
-- CXX COMPILER        | /opt/intel/oneapi/compiler/2022.1.0/mac/bin/intel64/icpc
-- COMPILE FLAGS       |  -qopenmp  -Wno-unknown-pragmas -g  -O2  -std=c++14
-- Build Type          | SHARED
-- MPI                 | ON
--   DYNAMIC           | OFF
--   INC               | /usr/local/Cellar/open-mpi/4.1.2/include
-- OpenMP              | ON
-- Use legacy units    | OFF
-- NMODL               | OFF
-- MOD2CPP PATH        | /Users/kumbhar/workarena/repos/bbp/nrn/build_intel_system_python/bin/mod2c_core
-- GPU Support         | OFF
-- Auto Timeout        | ON
-- Wrap exp()          | OFF
-- SplayTree Queue     | ON
-- NetReceive Buffer   | ON
-- Caliper             | OFF
-- Likwid              | OFF
-- Unit Tests          | OFF
-- Reporting           | OFF
-- --------------+--------------------------------------------------------------
--  See documentation : https://github.com/BlueBrain/CoreNeuron/
-- --------------+--------------------------------------------------------------
--
Extracting link flags from target 'Threads::Threads', beware that this can be fragile. Got:
Generating link flags from path /Library/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib Got: /Library/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib -Wl,-rpath,/Library/Frameworks/Python.framework/Versions/3.9/lib
Generating link flags from path /usr/local/Cellar/open-mpi/4.1.2/lib/libmpi.dylib Got: /usr/local/Cellar/open-mpi/4.1.2/lib/libmpi.dylib -Wl,-rpath,/usr/local/Cellar/open-mpi/4.1.2/lib
--
-- Configured NEURON 8.2.0
--
-- You can now build NEURON using:
--   cmake --build . --parallel 8 [--target TARGET]
-- You might want to adjust the number of parallel build jobs for your system.
-- Some non-default targets you might want to build:
-- --------------+--------------------------------------------------------------
--  Target       |   Description
-- --------------+--------------------------------------------------------------
-- install       | Will install NEURON to: /Users/kumbhar/workarena/repos/bbp/nrn/build_intel_system_python/install
--               | Change the install location of NEURON using:
--               |   cmake <src_path> -DCMAKE_INSTALL_PREFIX=<install_path>
-- docs          | Build full docs. Calls targets: doxygen, notebooks, sphinx, notebooks-clean
-- uninstall     | Removes files installed by make install (todo)
-- --------------+--------------------------------------------------------------
--  Build option | Status
-- --------------+--------------------------------------------------------------
-- C COMPILER    | /opt/intel/oneapi/compiler/2022.1.0/mac/bin/intel64/icc
-- CXX COMPILER  | /opt/intel/oneapi/compiler/2022.1.0/mac/bin/intel64/icpc
-- BUILD_TYPE    | RelWithDebInfo (allowed: Custom;Debug;Release;RelWithDebInfo;Fast)
-- COMPILE FLAGS | -g  -O2
-- Shared        | ON
-- Default units | modern units (2019 nist constants)
-- MPI           | ON
--   DYNAMIC     | OFF
--   INC         | /usr/local/Cellar/open-mpi/4.1.2/include
--   LIB         | /usr/local/Cellar/open-mpi/4.1.2/lib/libmpi.dylib
-- Python        | ON
--   EXE         | /Library/Frameworks/Python.framework/Versions/3.9/bin/python3
--   INC         | /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9
--   LIB         | /Library/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib
--   MODULE      | ON
--   DYNAMIC     | OFF
-- Readline      | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libreadline.tbd
-- Curses        | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libcurses.tbd;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libform.tbd
-- RX3D          | ON
--   OptLevel    | 0
-- Interviews    | OFF
-- CoreNEURON    | ON
--   PATH        | /Users/kumbhar/workarena/repos/bbp/nrn/external/coreneuron
--   LINK FLAGS  | -Lx86_64 -lcorenrnmech
--   Legacy Units| OFF
-- Tests         | OFF
-- --------------+--------------------------------------------------------------
--  See documentation : https://www.neuron.yale.edu/neuron/
-- --------------+--------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/kumbhar/workarena/repos/bbp/nrn/build_intel_system_python

And then tests are running fine:

PATH=`pwd`/install/bin:$PATH PYTHONPATH=`pwd`/install/lib/python/:$PYTHONPATH /Library/Frameworks/Python.framework/Versions/3.9/bin/python3
Python 3.9.10 (v3.9.10:f2f3f53782, Jan 13 2022, 17:02:14)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import neuron
>>> neuron.test()
testBytesize (neuron.tests.test_vector.VectorTestCase)
Test that Vector.__array_interface__ returns the proper bytesize (of a double) ... ok
testEndian (neuron.tests.test_vector.VectorTestCase)
Test that Vector.__array_interface__ returns the proper byteorder (endian) ... ok
testNumpyInteraction (neuron.tests.test_vector.VectorTestCase)
Testing numpy.array <=> hoc.Vector interaction ... ok
testPerformance (neuron.tests.test_vector.VectorTestCase)
Test performance of Vector<->list,array ...

Executed "l = range(1000000)".  Elapsed = 0.000029 s
Executed "v = h.Vector(l)".  Elapsed = 0.104567 s
inplace:
Executed "v.from_python(l)".  Elapsed = 0.104126 s
Executed "a = numpy.array(v)".  Elapsed = 0.001625 s
inplace:
Executed "v.to_python(a)".  Elapsed = 0.000884 s
Executed "v2 = h.Vector(a)".  Elapsed = 0.002167 s
inplace:
Executed "v2.from_python(a)".  Elapsed = 0.000883 s
Executed "l2 = list(v2)".  Elapsed = 0.039135 s
inplace:
Executed "v.to_python(l2)".  Elapsed = 0.009722 s
Executed "v2 = h.Vector(a[::-1])".  Elapsed = 0.002123 s
Executed "a2 = numpy.array(v2)".  Elapsed = 0.001504 s
ok
testABI (neuron.tests.test_neuron.NeuronTestCase)
Test use of some  Py_LIMITED_API for python3. ... ok
testExtendedSection (neuron.tests.test_neuron.NeuronTestCase) ... test:  ok
testHClass (neuron.tests.test_neuron.NeuronTestCase)
Test subclass of hoc class. ... ok
testHelp (neuron.tests.test_neuron.NeuronTestCase) ... Syntax:
    .. code-block::
        python

        h.xpanel('name')
        h.xpanel('name', [0-1])
        h.xpanel()
        h.xpanel(x, y)
        h.xpanel(scroll)
        h.xpanel(scroll, x, y)

Description:

    ``h.xpanel("name")``

    ``h.xpanel("name", [0-1])``
        Title of a new panel. Every
        button, menu, and value between this and a closing ``xpanel()`` command
        with no arguments (or placement args) belongs to this panel.
        If the form is used with a second argument equal to 1, then
        the panel is laid out horizontally. Otherwise the default is vertically.

    ``h.xpanel()``

    ``h.xpanel(x, y)``
        done constructing the panel. so map it to the screen with position
        optionally specified.

    ``h.xpanel(scroll)``

    ``h.xpanel(scroll, x, y)``
        as above but if the first arg is a number, then the value determines
        whether the panel will be inside a scrollbox. Scroll = 0 means a scrollbox
        will NOT be used. Scroll = 1 means the panel will be inside a scrollbox.
        Scroll = -1 is the default value and whether or not a scrollbox is used
        is determined by the number of panel items in comparison with the
        value of the panel_scroll property in the nrn.defaults file.

ok
testIterators (neuron.tests.test_neuron.NeuronTestCase)
Test section, segment, mechanism, rangevar iterators. ... ok
testRxDexistence (neuron.tests.test_neuron.NeuronTestCase) ... has_geometry3d is True
    basicRxD3D() ran with no exception
ok
testSectionArgOrder (neuron.tests.test_neuron.NeuronTestCase)
First optional arg for Section is name (but name="name" is recommended) ... ok
testSectionCell (neuron.tests.test_neuron.NeuronTestCase)
Section.cell() internally referenced as weakref. ... ok
testSectionListIterator (neuron.tests.test_neuron.NeuronTestCase)
As of v8.0, iteration over a SectionList does not change the cas ... ok
test_newobj_err (neuron.tests.test_neuron.NeuronTestCase)
Test deletion of incompletely constructed objects ...
NEURON: generate an error
 near line 1
 ob = new NewObj(1, 2)
                      ^
        NewObj[4].execerror("generate a...")
      NewObj[4].init(0, 2)
    NewObj[3].init(1, 2)
  NewObj[2].execute1("ob = new N...", NewObj[2])
and others
#NewObj and #Foo in existence 3 6
after del a #NewObj and #Foo in existence 0 0
ok
testpsection (neuron.tests.test_neuron.NeuronTestCase) ... ok

----------------------------------------------------------------------
Ran 15 tests in 2.504s

OK
True
>>>
pramodk commented 2 years ago

In summary:

@pmoolchand: may be you can confirm if using non-intel python works and this is acceptable solution in your case?