GithubHelp home page GithubHelp logo

Comments (5)

ChristophKirst avatar ChristophKirst commented on July 26, 2024

The erorr shows:
unsupported option -fopenmp

which points to a missing multiprocessing library OpenMP / MPI

Installing that library might fix the problem ? I fit is installed making its path available could help too.

We don't run ClearMap under Mac at this point, so I cannot be of much more help how to do that (possibly homebrew
or similar tools?) A software company is working on making the software available on Mac and Windows
(though this might take several months).

Hope that helps ?

from clearmap2.

cudmore avatar cudmore commented on July 26, 2024

Thanks for the info and solid lead about OpenMP. Looks like the stock clang on macOS (Sierra) does not support the multiprocessing library (OpenMP) out of the box. See Enable OpenMP support in clang in Mac OS X... for some tips.

Caveat: If your on macOS, no guarantee this will work. This was done on an older version (Sierra) and might not work on other versions. Also, I got ClearMap to compile but now can't really test if this compilation actually works as the pipeline for the full brain example data on osf.io/q6atb is way too big for my machine, see my post here. Would be great if we had a toy example with maybe 4 stacks rather than 100's? Goal would be for non-super-humans/computer to run the code :)

I got ClearMap to compile in two main steps:

1. Install llvm and libomp

brew update # took >1 hour
brew install llvm libomp 

The important llvm file is now in /usr/local/opt/llvm/include

2. Modify Python source code in conda environment

Need to modify the file envs/ClearMap/lib/python3.7/distutils/unixccompiler.py as follows ...

Basically, each time -fopenmp is passed to both compile and link steps, it needs to be preceded with the path to llvm, /usr/local/opt/llvm/include. Like this -I/usr/local/opt/llvm/include -fopenmp.

In def _compile()

       # start added by bob
       if extra_postargs:
        	if extra_postargs[-1] == '-fopenmp':
        		extra_postargs[-1] = '-I/usr/local/opt/llvm/include -fopenmp'        
       # end added by bob
       try:
            self.spawn(compiler_so + cc_args + [src, '-o', obj] +
                       extra_postargs)
        except DistutilsExecError as msg:
            raise CompileError(msg)

In def link()

                # start added by bob
                if ld_args:
        	        if ld_args[-1] == '-fopenmp':
        	        	ld_args[-1] = '-I/usr/local/opt/llvm/include -fopenmp'
                # end added by bob
                self.spawn(linker + ld_args) # original code

Then at an ipython prompt, the following works

import ClearMap.Compile 

Hope this helps some people on macOS?

from clearmap2.

ChristophKirst avatar ChristophKirst commented on July 26, 2024

Thanks for figuring this out !
We will include this in our updates!

from clearmap2.

ChristophKirst avatar ChristophKirst commented on July 26, 2024

This seems fixed, I am closing this issue. Feel free to reopen.

from clearmap2.

Yannan-Chen avatar Yannan-Chen commented on July 26, 2024

Faced same problem but on Ubuntu 20.04.3. Solved by running:

sudo apt-get install g++

from clearmap2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.