fzenke / auryn

Auryn: A fast simulator for spiking neural networks with synaptic plasticity
https://fzenke.net/auryn/
GNU General Public License v3.0
98 stars 42 forks source link

auryn installations step for mac #36

Closed Nazehs closed 2 years ago

Nazehs commented 2 years ago

I have tried following the steps provided for linux installations and it seems not working for me. Because of the below error

-- Checking for module 'mpi-c'
--   No package 'mpi-c' found
-- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_WORKS) 
-- Checking for module 'mpi-cxx'
--   No package 'mpi-cxx' found
-- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_WORKS) 
CMake Error at /Applications/CMake.app/Contents/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
Call Stack (most recent call first):
  /Applications/CMake.app/Contents/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /Applications/CMake.app/Contents/share/cmake-3.22/Modules/FindMPI.cmake:1830 (find_package_handle_standard_args)
  CMakeLists.txt:30 (FIND_PACKAGE)

What could possibly be the workaround for this pls

fzenke commented 2 years ago

It looks as if you are missing an MPI installation. You could try building without MPI as a possible workaround. It requires changing a few lines of code. Here are the instructions: https://fzenke.net/auryn/doku.php?id=manual:compileauryn&s[]=mpi#building_auryn_without_mpi I hope it helps.

Nazehs commented 2 years ago

Thank @fzenke I have tried following the instructions but it's leading to the below error:::

CMake Deprecation Warning at CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 2.8.12 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.

CMake Error at /usr/local/lib/cmake/Boost-1.78.0/BoostConfig.cmake:141 (find_package):
  Could not find a package configuration file provided by "boost_mpi"
  (requested version 1.78.0) with any of the following names:

    boost_mpiConfig.cmake
    boost_mpi-config.cmake

  Add the installation prefix of "boost_mpi" to CMAKE_PREFIX_PATH or set
  "boost_mpi_DIR" to a directory containing one of the above files.  If
  "boost_mpi" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  /usr/local/lib/cmake/Boost-1.78.0/BoostConfig.cmake:262 (boost_find_component)
  /Applications/CMake.app/Contents/share/cmake-3.22/Modules/FindBoost.cmake:594 (find_package)
  CMakeLists.txt:22 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!
See also "/Users/nazehabel/auryn/build/release/CMakeFiles/CMakeOutput.log".
See also "/Users/nazehabel/auryn/build/release/CMakeFiles/CMakeError.log".

I have removed the AURYN_CODE_USE_MPI definition on the auryn_definitions.h but for some reason, it seems like it's still been required.

Pardon me I am new to this framework and probably that's why I am having trouble going through things.

I did my boost installation via brew.

fzenke commented 2 years ago

No problem, could be that something has changed or that the instructions are incomplete. Now, in the CMakeLists.txt file try replacing this part

# Find Boost libraries                                                                                                                                                                             
SET(BOOST_MIN_VERSION "1.41.0")                                                                                                                                                                    
IF(MPI_FOUND)                                                                                                                                                                                      
    FIND_PACKAGE(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS mpi serialization program_options date_time unit_test_framework system filesystem)                                                 
ELSE()                                                                                                                                                                                             
    FIND_PACKAGE(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS serialization program_options date_time unit_test_framework system filesystem)                                                     
ENDIF()                                                                                                                                                                                            
# TODO add align to the components list once AurynVector uses it   

by

SET(BOOST_MIN_VERSION "1.41.0")
FIND_PACKAGE(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS serialization program_options date_time unit_test_framework system filesystem)
Nazehs commented 2 years ago

Thanks, I have been able to install it after following the first link you shared and I mentioned earlier that I installed boost but the boost I install was just a boost but commenting out the mpi config and then installing boost-mpi works.

However, I am having issues following your tutorial from https://fzenke.net/auryn/doku.php?id=manual:compileandrunaurynsimulations

running this make sim_new Makefile:19: *** missing separator. Stop.

I keep getting the missing operator at line 19 error from the make file.

I am trying this on Mac OS is the tutorial for a different OS?

# Update the following lines to your system requirements
AURYNPATH=$(HOME)/auryn

# Path to Auryn include files
AURYNINC=$(AURYNPATH)/src

# Path to Auryn library
AURYNLIB=$(AURYNPATH)/build/release/src

# The following should not require updating in most cases 
CXX = mpicxx
CXXFLAGS=-ansi -pipe -O3 -march=native -ffast-math -pedantic -I/usr/include -I$(AURYNINC)
LDFLAGS=$(AURYNLIB)/libauryn.a -lboost_filesystem -lboost_system -lboost_program_options -lboost_mpi -lboost_serialization

# Add your simulation's file name here as default target
all: sim_new

sim_%: sim_%.o
    $(CXX) $(CXXFLAGS) $< $(LDFLAGS) -o $(subst .o,,$<)

%.o : %.cpp
    $(CXX) $(CXXFLAGS) -c $<
fzenke commented 2 years ago

I only tested this on Linux. The missing separator error could be due to use of space instead of tab. See for instance: https://stackoverflow.com/questions/26403917/makefile-missing-separator-in-mac-os-x

Nazehs commented 2 years ago

okay thank i will have a look at and see if that will fix it/