Giter Club home page Giter Club logo

Comments (13)

albarji avatar albarji commented on July 20, 2024

Hi mrbell,

Thanks for reporting this problem. It looks like your compiler does not accept the -fopenmp option. This option is responsible for including the OpenMP libraries for multithreading. In Linux systems the standard C compiler (gcc) already bundles this library, but I honestly don't know about MacOS, as I build and tested everything under Linux.

Are you using gcc as well as your default C compiler? If not, a solution might be installing it.

from proxtv.

mrbell avatar mrbell commented on July 20, 2024

Yes, I am using gcc. I am not using the default older version, but an updated version from homebrew.

    $ gcc --version
    gcc (Homebrew gcc 4.9.2_1) 4.9.2
    Copyright (C) 2014 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

My version of clang is the MacOS default which could be an issue.

    $ clang++ --version
    Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
    Target: x86_64-apple-darwin14.3.0
    Thread model: posix

I'm going to try to update llvm tools and see if that fixes the issue.

from proxtv.

mrbell avatar mrbell commented on July 20, 2024

Tried updating clang this way:

    homebrew install llvm --with-clang

No luck. According to this SO thread, clang does not have OpenMP support on Mac.

I might be able to try installing an OpenMP supported Clang from here: https://clang-omp.github.io/

Is there any possibility of turning off OpenMP support? If so, how would I go about doing it? Honestly performance is not a big concern for me at the moment.

from proxtv.

albarji avatar albarji commented on July 20, 2024

I apologize for all the inconvenience. In the Matlab version of the package there is an option for compiling not using OpenMP, but I did not include it in the Python version. After this discussion though, it is clear it would be a valuable feature.

I will look into it. In the mean time I will try to spot where exactly the link to OpenMP needs be removed to tell you, so you can use the package as soon as possible.

from proxtv.

mrbell avatar mrbell commented on July 20, 2024

That would be great. Thanks for the support!
On Fri, Jun 12, 2015 at 11:34 AM Álvaro Barbero Jiménez <
[email protected]> wrote:

I apologize for all the inconvenience. In the Matlab version of the
package there is an option for compiling not using OpenMP, but I did not
include it in the Python version. After this discussion though, it is clear
it would be a valuable feature.

I will look into it. In the mean time I will try to spot where exactly the
link to OpenMP needs be removed to tell you, so you can use the package as
soon as possible.


Reply to this email directly or view it on GitHub
#12 (comment).

from proxtv.

albarji avatar albarji commented on July 20, 2024

I don't have access to a mac machine, but I think this may work. Could you please try adding

import os

# Force gcc compiler to prevent issues in mac
os.environ["CC"] = "gcc"
os.environ["CXX"] = "gcc"

to the top of setup.py, then compile the package? This will force the use of gcc, where OpenMP is supported. This way you can avoid calls to clang, I hope. This seems to have worked to other people: http://stackoverflow.com/questions/16737260/how-to-tell-distutils-to-use-gcc

from proxtv.

mrbell avatar mrbell commented on July 20, 2024

Thanks for the suggestion. I've tried it and get a different error at this point:

gcc -bundle -undefined dynamic_lookup 
-L/usr/local/lib -L/usr/local/opt/sqlite/lib 
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk 
/Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/prox_tv/__pycache__/_cffi__xeeb1e175x657f5e69.o 
/Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/condat_fast_tv.o 
/Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/johnsonRyanTV.o 
/Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/LPopt.o 
/Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TV2Dopt.o 
/Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TV2DWopt.o 
/Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TVgenopt.o 
/Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TVL1opt.o 
/Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TVL1Wopt.o 
/Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TVL2opt.o 
/Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TVLPopt.o 
/Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TVNDopt.o 
/Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/utils.o 
-llapack 
-o /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/_cffi__xeeb1e175x657f5e69.so 
-fopenmp

Traceback (most recent call last):
    File "setup.py", line 73, in <module>
        zip_safe=False,
    File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup 
        dist.run_commands()
    File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands 
        self.run_command(cmd)
    File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 971, in run_command 
        cmd_obj.ensure_finalized()
    File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
        self.finalize_options()
    File "setup.py", line 24, in finalize_options
        self.distribution.ext_modules = get_ext_modules()
    File "setup.py", line 16, in get_ext_modules
        from prox_tv._prox_tv import _ffi
    File "/Users/mbell/Downloads/proxTV-master/prox_tv/__init__.py", line 1, in <module>
        from ._prox_tv import *
    File "/Users/mbell/Downloads/proxTV-master/prox_tv/_prox_tv.py", line 171, in <module>
        libraries=['lapack'])
    File "/Users/mbell/Downloads/proxTV-master/.eggs/cffi-1.1.2-py2.7-macosx-10.10-x86_64.egg/cffi/api.py", line 373, in verify
        lib = self.verifier.load_library()
    File "/Users/mbell/Downloads/proxTV-master/.eggs/cffi-1.1.2-py2.7-macosx-10.10-x86_64.egg/cffi/verifier.py", line 97, in load_library
        return self._load_library()
    File "/Users/mbell/Downloads/proxTV-master/.eggs/cffi-1.1.2-py2.7-macosx-10.10-x86_64.egg/cffi/verifier.py", line 207, in _load_library
        return self._vengine.load_library()
    File "/Users/mbell/Downloads/proxTV-master/.eggs/cffi-1.1.2-py2.7-macosx-10.10-x86_64.egg/cffi/vengine_cpy.py", line 155, in load_library
        raise ffiplatform.VerificationError(error)
cffi.ffiplatform.VerificationError: importing '/Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/_cffi__xeeb1e175x657f5e69.so': dlopen(/Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/_cffi__xeeb1e175x657f5e69.so, 2): Symbol not found: __gfortran_st_write
Referenced from: /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/_cffi__xeeb1e175x657f5e69.so
Expected in: flat namespace
in /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/_cffi__xeeb1e175x657f5e69.so

from proxtv.

albarji avatar albarji commented on July 20, 2024

Thanks for the report. It seems like you might need gfortran installed as well as gcc, probably due to the linking of the LAPACK/BLAS libraries that proxTV makes use of. Could you please check whether you have gfortran installed? Please also install whathever fortran development packages you can find for your OS.

from proxtv.

mrbell avatar mrbell commented on July 20, 2024

I have gfortran installed.

$ gfortran --version
GNU Fortran (Homebrew gcc 4.9.2_1) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.

I believe the homebrew package includes the appropriate development libraries/headers.

from proxtv.

albarji avatar albarji commented on July 20, 2024

Hi again,

My colleage Suvrit suggests that the root cause of this issue might be that in your Mac installation gcc might actually be a symlink to clang and not to gnu gcc. You might have to write the explicit path to gnu gcc in the setup.py file above.

I'm sorry I can't be of more help, but I don't have access to a mac machine. I thought of creating a MacOS virtual machine for testing this, but as it turns out Apple doesn't legally approve virtualizing MacOS on top of non-mac hardware...

from proxtv.

fabianp avatar fabianp commented on July 20, 2024

Submitted PR #15 to solve this

from proxtv.

albarji avatar albarji commented on July 20, 2024

@fabianp , thanks for the PR! Currently I'm overworked with other projects, so my apologies for not checking it yet. I hope I can get back to this project at some point during March.

from proxtv.

albarji avatar albarji commented on July 20, 2024

This should be solved now thanks to PR #15

from proxtv.

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.