Install caffe/pycaffe on MacOSX High Sierra - python

I'm following this tutorial to install caffe on my OSX High Sierra.
I followed all steps but I'm stucked when installing R-CNN example at this step:
$ make -j8 && make pycaffe
LD -o .build_release/lib/libcaffe.so
clang: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
ld: cannot link directly with /System/Library/Frameworks//vecLib.framework/vecLib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [.build_release/lib/libcaffe.so] Error 1
But the library veclib is present:
$ ls /System/Library/Frameworks//vecLib.framework/vecLib
/System/Library/Frameworks//vecLib.framework/vecLib
Can you help me please to solve this issue ?

I met the same issue. I installed Xcode 9.3 Commandline tool and changed cmake/Modules/FindvecLib.cmake to something like this and it works:
find_path(vecLib_INCLUDE_DIR cblas.h
DOC "vecLib include directory"
PATHS /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
NO_DEFAULT_PATH)
For my case, NO_DEFAULT_PATH must be set or there will be still link error.
You can also refer to this.

Related

Quantlib Mac OSX - ld: symbol(s) not found for architecture arm64

I want to install Quantlib from source to enable intraday support for Python. When installing QuantLib from source on Mac OSX 11.1 with M1 chip I am facing a problem during the 'make' in the tests.
Undefined symbols for architecture arm64:
"_PrimitivePolynomials", referenced from:
LowDiscrepancyTest::testPolynomialsModuloTwo() in lowdiscrepancysequences.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [quantlib-test-suite] Error 1
make: *** [all-recursive] Error 1
This looks like the linker is not finding the QuantLib libraries you have just compiled, and is instead trying to link to a version compiled for a different architecture. Try running make install or sudo make install prior to compiling the tests -- if that works, then you have something going on with your library paths.

Installing tensorflow-gpu on CentOS 6.8

System Information
OS: CentOS 6.8Python: 2.7.11
Problem
Hi all, I would like to install tensorflow. Since I am using CentOS 6.8, it seems there is not official way to install tensoflow. Therefore, I googled for several ways to install it, and I followed this guide: https://blog.abysm.org/2016/06/building-tensorflow-centos-6/
(Other guides didn't work for me, some are glibc problem, some are "not a support wheel" problem, etc.)
However, now I would like to use GPU to accelerate. I have installed cuda and cudnn, but when I tried to build tensorflow with gpu in a way similar to the guide mentioned above(in the ./configure step I chose "enable cuda"), I got errors like this:
[root#Linux1 tensorflow]# ~/bin/bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
ERROR: /root/.cache/bazel/_bazel_root/a3c166d17dc24b80d65cd498892a86b2/external/protobuf/BUILD:609:1: Linking of rule '#protobuf//:python/google/protobuf/internal/_api_implementation.so' failed: link_dynamic_library.sh
failed: error executing command external/bazel_tools/tools/cpp/link_dynamic_library.sh no ignored ignored ignored
external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -shared -o ... (remaining 10 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
/usr/bin/ld: unrecognized option '-plugin'
/usr/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 14.665s, Critical Path: 2.62s
I am new to linux, and I have no idea what's going on. Is there possible way to solve this problem? Thanks in advance.

/usr/local/include/tk.h:71:13: fatal error: 'X11/Xlib.h' file not found when install python library

I have a virtual env for python, and trying to install some packages in the virtual-env:
sudo /Users/edamame/Library/python_virenv/bin/pip install matplotlib
Then I got the following error:
:
:
clang: warning: -framework Tcl: 'linker' input unused
clang: warning: -framework Tk: 'linker' input unused
In file included from src/_tkagg.cpp:28:
/usr/local/include/tk.h:71:13: fatal error: 'X11/Xlib.h' file not found
# include <X11/Xlib.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
I am on Mac El-Captain, and I have:
edamame$ locate Xlib.h
WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.
Any idea how I can fix this problem? Thanks!
You should either install the development files for X11 (from memory: libx11-dev), or if they are already installed, add the X11 directory to your include search path.
You can use locate Xlib.h to figure out if the files are already there. Use the -I compiler option to add directories to your search path.

Error installing psycopg on OSX (yosemite) using PIP

I'm getting a strange linker error that I don't completely understand while attempting to install postgresql on OSX.
I've installed Postgres via Brew and now I'm trying to get my Django app up and running. I've added the postgres directory to my path. I'm running OSX Yosemite.
When I run the following command:
pip install psycopg2
I get this error:
ld: illegal text reloc in '_init_psycopg' to '_lobjectType' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'cc' failed with exit status 1
I'm at a loss where to go from here and my searches for this type of error has lead me no where. Any help would be amazing.
Thanks.
Turns out I had a couple versions of Postgres installed. I had to remove the old one and make sure the pg_config that was found in the PATH was the most recent one. As soon as I made sure the pg_config was the proper one, this error went away.

Can't compile PIL in Virtualenv

The latest pip 1.5 and Xcode 5.1 have made it difficult to install PIL in an virtualenv.
I have googled for various solutions and it seems I had to execute these two lines:
export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
pip install PIL --allow-external PIL --allow-unverified PIL
However I am still getting an exception and I have no idea why. My colleague on a different machine has no problem with it.
I have installed Python and latest Xcode with Commandline Tools. Maybe the latter is corrupted?
clang: warning: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
clang: warning: argument unused during compilation: '-mno-fused-madd'
In file included from _imaging.c:75:
In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:19:
In file included from /usr/bin/../lib/clang/5.1/include/limits.h:38:
/usr/include/limits.h:63:10: fatal error: 'sys/cdefs.h' file not found
#include <sys/cdefs.h>
^
1 error generated.
error: command 'clang' failed with exit status 1
Try adding these to your .profile
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

Categories