Make error in caffe - installation

Output for 'make all'
[root#parags-pc caffe]# make all
CXX src/caffe/layers/batch_norm_layer.cpp
CXX src/caffe/layers/sigmoid_layer.cpp
CXX src/caffe/layer.cpp
CXX src/caffe/layer_factory.cpp
CXX src/caffe/data_transformer.cpp
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so
/usr/bin/ld: cannot find -lcblas
/usr/bin/ld: cannot find -latlas
collect2: error: ld returned 1 exit status
Makefile:544: recipe for target '.build_release/lib/libcaffe.so' failed
make: *** [.build_release/lib/libcaffe.so] Error 1
[root#parags-pc caffe]#
I have been trying to install caffe on fedora 21 with little success. On running the following make command I get the errors as given in the screenshot.
I have tried the following to fix this but have had no success.
[root#parags-pc caffe]# export LDFLAGS=-L/lib64/atlas/
[root#parags-pc caffe]# ld -lcblas --verbose
==================================================
attempt to open /usr/x86_64-redhat-linux/lib64/libcblas.so failed
attempt to open /usr/x86_64-redhat-linux/lib64/libcblas.a failed
attempt to open /usr/local/lib64/libcblas.so failed
attempt to open /usr/local/lib64/libcblas.a failed
attempt to open /lib64/libcblas.so failed
attempt to open /lib64/libcblas.a failed
attempt to open /usr/lib64/libcblas.so failed
attempt to open /usr/lib64/libcblas.a failed
attempt to open /usr/x86_64-redhat-linux/lib/libcblas.so failed
attempt to open /usr/x86_64-redhat-linux/lib/libcblas.a failed
attempt to open /usr/lib64/libcblas.so failed
attempt to open /usr/lib64/libcblas.a failed
attempt to open /usr/local/lib/libcblas.so failed
attempt to open /usr/local/lib/libcblas.a failed
attempt to open /lib/libcblas.so failed
attempt to open /lib/libcblas.a failed
attempt to open /usr/lib/libcblas.so failed
attempt to open /usr/lib/libcblas.a failed
ld: cannot find -lcblas
[root#parags-pc caffe]#
The contents of /lib64/atlas/ are as shown below I am not sure though if these are the required libraries.
[root#parags-pc caffe]# ls /lib64/atlas/
libsatlas.so.3 libsatlas.so.3.10 libtatlas.so.3 libtatlas.so.3.10
Google say's to make use of -L to link command. But I don't know which command should be used, how that command is to be used and which libraries should be linked.
I need help please. Thanks!

cd /lib64/atlas
sudo ln -s libtatlas.so /lib/libatlas.so
sudo ln -s libtatlas.so /lib/libcblas.so
The new Atlas ver3 is bundled with both atlas and cblas. Thus there is no need to include both of them separately.
Either you can follow the above method or remove calling the cblas library in your makefile.

I think the reason is you use make to compile, which makes caffe's python port only find libraries in this catalog. Maybe you use cmaketo compile and it could work.
$make clean
$cd caffe-master
$mkdir build
$cd build
$cmake ..
$make all -j8
I hope I could help you!

Related

Unable to build project for ESP32

I am trying to build project esp-obd-emulator I always get the following error, maybe someone can help me with that.
I am using esp-idf to build project.
C:\Users\edvar\Desktop\esp-idf-2\examples\emu>idf.py build
Checking Python dependencies...
Python requirements from C:\Users\edvar\Desktop\esp-idf-2\requirements.txt are satisfied.
Executing action: all (aliases: build)
Running ninja in directory c:\users\edvar\desktop\esp-idf-2\examples\emu\build
Executing "ninja all"...
[1/5] Performing build step for 'bootloader'
ninja: no work to do.
[2/3] Linking CXX executable emu.elf
FAILED: emu.elf
cmd.exe /C "cd . && C:\Users\edvar\.espressif\tools\xtensa-esp32-elf\esp-2019r2-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe -mlongcalls -Wno-frame-address -nostdlib #CMakeFiles\emu.elf.rsp -o emu.elf && cd ."
c:/users/edvar/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/esp32/libesp32.a(cpu_start.c.obj):(.literal.main_task+0x18): undefined reference to `app_main'
c:/users/edvar/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/esp32/libesp32.a(cpu_start.c.obj): in function `main_task':
C:/Users/edvar/Desktop/esp-idf-2/components/esp32/cpu_start.c:539: undefined reference to `app_main'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
esp-obd-emulator seems to not have been ported to ESP-IDF 2.0; it seems to still be using Make instead of CMake. Either compile this with an old version of ESP-IDF, or ask it to be updated to CMake.

Xcode project built - Permission denied

I built an Xcode project from CMake and when I attempt to build it I get the following error.
PhaseScriptExecution CMake\ Rules /Users/LaserTech/NewBuild/Myjob2/NameCreate.build/Debug/lsjob2.build/Script-E70CB352E1334BCA9B8BE7C1.sh
cd /Users/LaserTech/NameCreate-OSG-Qt5
/bin/sh -c /Users/LaserTech/NewBuild/Myjob2/NameCreate.build/Debug/Myjob2.build/Script-E70CB352E1334BCA9B8BE7C1.sh
make: *** No rule to make target `/Users/LaserTech/NameCreate-OSG-Qt5/Myjob2/PROTOBUF_PROTOC_EXECUTABLE-NOTFOUND', needed by `/Users/LaserTech/NewBuild/Myjob2/common.pb.cc'. Stop.
Command /bin/sh failed with exit code 2
I am not sure what this means. I would appreciate it if someone could shine some light onto what I should be looking at ?
Update:
I did have thoses packages installed. I needed to simply add the path to the binaries to the environment variable. However now xcode is giving me this
echo "Running C++ protocol buffer compiler on protocol/common.proto"
Running C++ protocol buffer compiler on protocol/common.proto
/Users/..../cmake/osxbuild/Release --cpp_out /Users/..../Myjob2 -I /Users/.../Myjob2/protocol /Users/../Myjob2/protocol/common.proto
make: /Users/.../protobuf/cmake/osxbuild/Release: Permission denied
make: *** [/Users/../NewBuild/Myjob2/common.pb.cc] Error 1

Install nullfs on Debian

I am using a java program. It automatically creates log files in a directory, but I am doing that myself a different way with tee. I cannot find an easy way to disable the logs, so I am resorting to using nullfs.
I cloned it with
git clone https://github.com/xrgtn/nullfs.git
and I ran
make nul1fs
as instructed. It terminates within a second, with the following output:
cc "-lfuse" nul1fs.c -o nul1fs
nul1fs.c:13:18: fatal error: fuse.h: No such file or directory
compilation terminated.
make: *** [nul1fs] Error 1
I tried apt-get source fuse and copying fuse.h into the nullfs directory, but nothing changed.
I have FUSE installed. I'm running Debian wheezy x86_64.
You need the development package of FUSE, which contains the fuse.h you're missing. Do a apt-get install libfuse-dev and it should work.
Copying the header file in the source directory did not work, because in nul1fs.c you'll notice that fuse.h is included with angle brackets. This means, the header file will be searched in the system-wide include paths. That usually means /usr/include.
Note that you then may run into this error:
$ make nul1fs
cc "-lfuse" nul1fs.c -o nul1fs
/tmp/ccbt0X7c.o: In function `main':
nul1fs.c:(.text+0x3c3): undefined reference to `fuse_main_real'
collect2: error: ld returned 1 exit status
make: *** [nul1fs] Error 1
It's a documented bug with a workaround: put the linker flags after the file lists. I.e. compile nul1fs with:
cc nul1fs.c -o nul1fs -lfuse
and not with make nul1fs, which boils down to
cc -lfuse nul1fs.c -o nul1fs

cygwin linking error

I want to make network simulator shawn.exe with cygwin and that simulator need to boost library
when i call make for it in the linking step procedure break.
please help me,
this is all result of make command:
{.
.
[100%] Built target shawnlib
Scanning dependencies of target shawn
[100%] Building CXX object CMakeFiles/shawn.dir/frontend/console/con_main.o
[100%] Building CXX object CMakeFiles/shawn.dir/apps/apps_init.o
Linking CXX executable shawn.exe
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lboost_regex-gcc-mt
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lboost_date_time-gcc-mt
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lboost_thread-gcc-mt
collect2: ld returned 1 exit status
CMakeFiles/shawn.dir/build.make:111: recipe for target `shawn.exe' failed
make[2]: *** [shawn.exe] Error 1
CMakeFiles/Makefile2:60: recipe for target `CMakeFiles/shawn.dir/all' failed
make[1]: *** [CMakeFiles/shawn.dir/all] Error 2
Makefile:72: recipe for target `all' failed
make: *** [all] Error 2
}
Make sure you have the libboost-devel Cygwin package installed. Re-run Cygwin's setup.exe and install that package (as well as its dependencies, which should automatically get installed if you don't explicitly exclude them).
no need to reinstall cygwin. just run:
apt-cyg install libboost-devel.
if you don't have "apt-cyg" installed, run these steps first:
lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg
install apt-cyg /bin

Problems linking to a library with gcc

I installed SFML from scratch today so I could work on a game. I downloaded the source, ran sudo make install, tried compiling one of my old projects, and I couldn't get it to link properly. So I tried running a simpler project: one of the samples in the tutorials. I tried to compile this one specifically, but I get these errors:
g++ -o atest test.cpp -lsfml-graphics -lsfml-window -lsfml-system /tmp/ccaa86fR.o: In function `main':
test.cpp:(.text+0x1d2): undefined reference to `gluPerspective'
collect2: ld returned 1 exit status
make: *** [test] Error 1
Trying an even simpler project, the one in the initial tutorial, I don't run into problems compiling. However, when I try to run it, I get this error:
./atest: error while loading shared libraries: libsfml-graphics.so.1.6: cannot open shared object file: No such file or directory
I checked, and the files did install to /usr/local/lib/ which is where they're supposed to go as far as I know. What am I doing wrong here?
-lGLU should fix the first error and for the second one make sure /usr/local/lib/ is in your ldconfig search path (/etc/ld.so.conf and /etc/ld.so.conf.d/* under Ubuntu) and that you ran ldconfig: sudo ldconfig -v then try running again.
see also man ldconfig

Resources