Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved CMake scripts #1667

Closed
wants to merge 19 commits into from
Closed

Improved CMake scripts #1667

wants to merge 19 commits into from

Conversation

Nerei
Copy link

@Nerei Nerei commented Jan 2, 2015

@shelhamer @jeffdonahue @baeuml @kloudkl @akosiorek @Yangqing @BlGene

Hello all,

hope I referenced everyone who participated cmake development (at least I didn't find others)

Following discussion here #1586, as I promised, I prepared slightly improved caffe cmake scripts. The improvement was developed using Ubuntu 14.04 and tested on Yosemite (with libstdc++). I believe Windows support now is as difficult as compiling all dependencies. But I prefer to postpone testing on Windows until current very linux-ish build scripts and behaviour are slightly adapted for cross-platform use and some dependencies are made optional.

Description of changes and new features added

Added OpenCV like formatted configuration log
https://travis-ci.org/BVLC/caffe/jobs/45700248

Added CaffeConfig.cmake generation for build/install cases.
This allows you to connect Caffe to your application using CMake's find_package(Caffe). For more detailed description see below.

BUILD_SHARED_LIB=ON (default) or OFF
build caffe as shared library. In CMake it not good practice to build both shared and static simultaneously. That’s why the switch.

CPU_ONLY = OFF(default) or ON
Forces excluding CUDA support. Also Caffe will compile in CPU_ONLY mode if CUDA Toolkit is not installed or found by cmake. Before build please read chic configuration log dumped by cmake to control this case.

USE_CUDNN = ON (default)
If enabled and cudnn is found build with it, otherwise build without.

CUDA_ARCH_NAME=Auto(default), All, Fermi, Kepler, Maxwell, Manual
specifies target GPU architecture, Selecting concrete value reduces CUDA code compilation time (for instance compilation for sm_20 and sm_30 is twice longer than just for one of them). In case of Auto, cmake will make an attempt to detect GPUS installed in your computer and compile only for them. In case of manual, new CUDA_ARCH_BIN/PTX cmake variables are created where space separated list of architectures should be set. Example, CUDA_ARCH_BIN=”20 21(20) 50”

BUILD_docs = ON (default)

  • If doxygen installed and found enables doc target. Use make docs to build and make jekyll to run web server. html docs are built in <source folder>/doxygen, and next symlink is created in <source folder>/docs/doxygen. Functionality from scripts/gather_examples.sh is now implemented in cmake, but copy_notebook.py is still required.
  • Source folder for generation is used because .Doxyfile contains relative paths and I prefer not to modify it now, but think generation in binary folder is better

BUILD_python = ON (default)
Build python interface if all required dependencies found, otherwise excluded from build automatically

BUILD_matlab = OFF(default)
Enables building matlab interfaces. Currently it supports both Octave and Matlab. For Octave set Octave_compiler to mkoctfile if not found automatically. For Matlab specify Matlab_DIR or Matlab_mex and Matlab_mexext if again not found automatically. If both installed and found, to select which one to use, set Matlab_build_mex_using=Matlab(default) or Octave. Note matlab wrappers can only be built if BUILD_SHARED_LIB=On. On macos both doesn’t compile.

Proto-files
Now protobuf files ARE NOT copied to <caffe_root>/include/caffe/proto anymore. Instead they are generated to <build_dir>/include/caffe/proto. Know one may include old headers, but this is interest rates to payback of technical debt appeared due to incorrect original cmake scripts design. Also removed them from .gitignore

test.testbin

  • Now NO cmake_test_defines.hpp and sample_data_list.txt are configured by cmake to source directory and NO -DCMAKE_BUILD definition added and all *.in templates were removed. This is because make runtest command is executed in source directory, and embedding absolute paths to test cpp-files is not required! Consider configure_file() to source folder as antipattern. However, one may return such embedding by uncommenting couple lines in srcs/test/CMakeLists.txt.
  • All garbage targets (one per each test file) were removed because they flood IDEs while compilation time reduction is controversial. I replaced them with option BUILD_only_tests that allows quickly include only selected tests. Example: cmake -DBUILD_only_tests=="common,net,blob,im2col_kernel"

Yosemite support
I was able to compile with CUDA support using the Caffe instruction with libstdc++ and patching opencv as here opencv/opencv@32f6e1a. Accelerate.framework support added. Matlab interface was failed to compile.

Temporary changes

  • make symlink creates symlink [caffe_root]/build -> cmake_build_directory
  • Now all examples are built without .bin suffix and next symlink with .bin suffix created nearby. So that tutorials could work. Once naming standardized, should remove this.

Including Caffe in your CMake project via find_package()

git clone git@github.com:BVLC/caffe.git. 
cd caffe && mkdir cmake_build && cd cmake_build
cmake .. -DBUILD_SHARED_LIB=ON

Verify that cmake found everything and in proper locations. After can run make -j 12 right now or better do this:

cmake . -DCMAKE_BUILD_TYPE=Debug     # switch to debug
make -j 12 && make install           # installs by default to build_dir/install
cmake . -DCMAKE_BUILD_TYPE=Release   # switch to release
make -j 12 && make install           # doesn’t overwrite debug install
make symlink

After the operations complete, caffe tutorials should work from caffe root directory. Let’s now see how to connect caffe to a C++ application that uses Caffe API with cmake. Prepare the following script:

cmake_minimum_required(VERSION 2.8.8)

find_package(Caffe)
include_directories(${Caffe_INCLUDE_DIRS})
add_definitions(${Caffe_DEFINITIONS})    # ex. -DCPU_ONLY

add_executable(caffeinated_application main.cpp)
target_link_libraries(caffeinated_application ${Caffe_LIBRARIES})

Run CMake to configure this application and generate build scripts or IDE project. It will automatically find Caffe in its build directory and pick up all necessarily dependencies (includes, libraries, definitions) and application will compile without any additional actions. Caffe dependencies will also have been included. If you have several Caffe builds or for some reason Cmake wasn’t able find Caffe automatically, you may specify Caffe_DIR=<path-to-caffe-build-dir> in Cmake and this guarantees that everything will work.

Specified Caffe_DIR to build directory leads to always using a build configuration (say, Release or Debug) Caffe compiled last time for. If you set Caffe_DIR=<caffe-install-dir>/share/Caffe where both configurations have been installed, proper debug or release caffe binaries will be selected depending on for which configuration you compile your caffeinated_application.

Enjoy!!

(Fixed typos in CUDA architectures - @Noiredd)

@Nerei Nerei force-pushed the feature/cmake_well_done branch 4 times, most recently from 60e8f7a to 10b8523 Compare January 3, 2015 12:35
@Nerei
Copy link
Author

Nerei commented Jan 3, 2015

Nerei@60e8f7a#commitcomment-9141630 According to this @longjon 's comment, I reverted last commit where I had reduced NumPy requirements from 1.7.1. to 1.6.1. But now python interface compilation is not tested by Travis CI. Need to update numpy there.

@longjon
Copy link
Contributor

longjon commented Jan 3, 2015

Re: numpy versions, Travis should use a recent version after #1473. (If we want to build pycaffe with these CMake updates before that, the Travis build script could be modified to force CMake to go ahead with an older version, either by some CMake switch that I don't know, or by actually updating the CMake script before the build.)

@Nerei
Copy link
Author

Nerei commented Jan 4, 2015

I noticed that some tasty python features are being implemented (Once they're done, I'm ready to prepare new PR with its support)

@shelhamer
Copy link
Member

@Nerei thanks for the effort to improve the CMake build and align it with the features of the Makefile. Nice to have the pieces in place to include Caffe in other projects too.

Regarding the shared or static library build, I'd rather the shared library be the default since it is used more commonly (right?).

@bhack
Copy link
Contributor

bhack commented Jan 5, 2015

👍 for shared default

@Nerei
Copy link
Author

Nerei commented Jan 5, 2015

Absolutely agree that shared is better! Just it was for similarity with previous vesion.

@Nerei Nerei force-pushed the feature/cmake_well_done branch 4 times, most recently from e9adae7 to 1fc6f2c Compare January 7, 2015 14:52
@bhack
Copy link
Contributor

bhack commented Jan 11, 2015

@Nerei I'm guessing what is the support status for windows generators with this refactoring. Working VS generators could help people at #15

@bhack bhack mentioned this pull request Jan 11, 2015
@shelhamer
Copy link
Member

Great work @Nerei! Is this ready for review or are there further changes planned for this PR?

(Of course more can be done in follow ups, such as CMake support for the new Python features that are on track for merge.)

@Nerei Nerei closed this Jan 11, 2015
@Nerei Nerei reopened this Jan 11, 2015
@Nerei
Copy link
Author

Nerei commented Jan 11, 2015

To: @bhack CC: @shelhamer @Yangqing

Absolutely, agree that can use windows generators with cmake. But now I don't think that windows is currently supported by caffe without modifications.

If you compile caffe as dynamic library, Attribute __declspec(dllexport) using macro like here should be added to the beginning of EACH class and function in caffe, otherwise the symbols won't be visible from outside of dll-library. In case of static compilation, current layer registration scheme (introduced in @Yangqing's commit 2f88dab) doesn't work because unreferenced static constructors that register layers are just excluded by linker. To fix this, caffe uses workaround in Makefile.

For Windows, one may try -DCMAKE_CXX_FLAGS=/OPT:NOREF option, But I'd rather rewrite the code since anyway it is not very cross-platform, produces difficulties with different compilers, with Matlab/Octave interface and even with clang for ubuntu (--force-load only for shared libraries not for executables). Even if I make it work for some set of compilers now, it would be difficult to support and test these scripts in future for different configurations.

@Nerei
Copy link
Author

Nerei commented Jan 11, 2015

@shelhamer Thanks! I think it's ready for review. At least future changes, like windows support or improvements, I would cover in separate PR.

I think better to fetch the branch and review cmake-files locally, it should be easy to read. I wanted to write them as very readable, all difficulties are separated as macros, most of which I just copy-pasted from my projects and opencv. My aim was to create some well done basis/style and standardize it, so that it would be clear where/how to write changes in future.

@Nerei
Copy link
Author

Nerei commented Jan 11, 2015

Regarding windows, I might be worth creating a repository with cmakeified dependencies so that one can compile and use use the dependencies for caffe compilation "in couple clicks". I can help with this since I am primary a windows user.

@bhack
Copy link
Contributor

bhack commented Jan 11, 2015

@Nerei I'm not a window user but in past for other projects we have used MXE on Linux to cross compile dependencies. It integrates also well with Cmake.

@Nerei
Copy link
Author

Nerei commented Jan 11, 2015

@bhack Interesting. But cmake scripts are required to be written anyway. And this cross-compile tool uses mingw (gcc port to windows), and its output can't be used from Visual Studio, only from mingw.

@bhack
Copy link
Contributor

bhack commented Jan 11, 2015

@Nerei VS generators are a feature of cmake. FindScripts need to be written or copied by other BSD project for correct multiplatform support (ones that are not already distributed by Cmake). Mxe is only for building easly I.e. widows dependencies from Linux or easily compiling caffe for windows target in Linux with almost the actual infrastructure.

@Nerei
Copy link
Author

Nerei commented Jan 11, 2015

Yes. you're completely right, you can compile caffe.exe from linux for windows and use the executable. there. But not cafe.lib to link into your Visual Studio application. The same with dependencies.

@bhack
Copy link
Contributor

bhack commented Jan 11, 2015

Static library are directly supported in VS. Also dynamic ones are supported with some additional steps

@Nerei
Copy link
Author

Nerei commented May 23, 2016

Please ask on caffe forums. Actually you should set Caffe_DIR to caffe build directory, not source one.

@nineilpitt
Copy link

Hi all,

I have installed caffe and have tested with a mnist script. That one is working, also with the gpu :)

Now, I am trying to work with the matlab interface. I am testing with the basic demo from CAFFE_FOLDER/matlab/demo

However, I am getting the error:

[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.0.0 of the Protocol Buffer runtime library, but the installed version is 2.5.0. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "google/protobuf/any.pb.cc".)

I have verified that I have the proto version 3.00 in my path with 'protoc --version' in console and also in matlab with unix('protoc --version') and I am getting version 3.00. However, still has the previous error.

Any suggestions ?

Thanks.

@moumitaTora
Copy link

I am continuously getting this error while trying to install Caffe using CMake:
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libglog.so: undefined reference to `google::FlagRegisterer::FlagRegisterer(char const_, char const_, char const_, char const_, void_, void_)'

Please help!

@ssamira
Copy link

ssamira commented Jul 4, 2016

Hello,

I am trying to use Caffe API in my project in visual studio but I have the same issue as @InfiniteLifeH has, @Nerei I set Caffe_DIR to build and still have the problem. I am getting this warning in Cmake :

CMake Warning at (find_package):
By not providing "FindCaffe.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Caffe", but
CMake did not find one.

Could not find a package configuration file provided by "Caffe" with any of
the following names:

CaffeConfig.cmake
caffe-config.cmake

Add the installation prefix of "Caffe" to CMAKE_PREFIX_PATH or set
"Caffe_DIR" to a directory containing one of the above files. If "Caffe"
provides a separate development package or SDK, be sure it has been
installed.
Any suggestions?

Thanks,

@cervantes-loves-ai
Copy link

hi, can anyone help me for this error?

[----------] 2 tests from BatchReindexLayerTest/1, where TypeParam = caffe::CPUDevice
[ RUN ] BatchReindexLayerTest/1.TestForward
[ OK ] BatchReindexLayerTest/1.TestForward (0 ms)
[ RUN ] BatchReindexLayerTest/1.TestGradient
[ OK ] BatchReindexLayerTest/1.TestGradient (87 ms)
[----------] 2 tests from BatchReindexLayerTest/1 (87 ms total)

[----------] 5 tests from ImageDataLayerTest/1, where TypeParam = caffe::CPUDevice
[ RUN ] ImageDataLayerTest/1.TestReshape
[ OK ] ImageDataLayerTest/1.TestReshape (46 ms)
[ RUN ] ImageDataLayerTest/1.TestShuffle
[ OK ] ImageDataLayerTest/1.TestShuffle (106 ms)
[ RUN ] ImageDataLayerTest/1.TestRead
[ OK ] ImageDataLayerTest/1.TestRead (103 ms)
[ RUN ] ImageDataLayerTest/1.TestResize
[ OK ] ImageDataLayerTest/1.TestResize (122 ms)
[ RUN ] ImageDataLayerTest/1.TestSpace
[ OK ] ImageDataLayerTest/1.TestSpace (63 ms)
[----------] 5 tests from ImageDataLayerTest/1 (440 ms total)

[----------] Global test environment tear-down
[==========] 1096 tests from 150 test cases ran. (68513 ms total)
[ PASSED ] 1095 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] NeuronLayerTest/0.TestPReLUForward, where TypeParam = caffe::CPUDevice

1 FAILED TEST
make[3]: *** [src/caffe/test/CMakeFiles/runtest] Error 1
make[2]: *** [src/caffe/test/CMakeFiles/runtest.dir/all] Error 2
make[1]: *** [src/caffe/test/CMakeFiles/runtest.dir/rule] Error 2
make: *** [runtest] Error 2

@riteshpradhan
Copy link

riteshpradhan commented Jul 28, 2016

make symlink
make: *** No rule to make targetsymlink'. Stop.`

it's not working.

@gaopinghai
Copy link

i run into this problem:

[ 88%] Building CXX object src/caffe/CMakeFiles/caffe.dir/layer.cpp.o
Linking CXX shared library ../../lib/libcaffe-d.so
/usr/bin/ld: /usr/local/lib/libcblas.a(cblas_sgemv.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libcblas.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libcaffe-d.so.1.0.0-rc3] Error 1
make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
make: *** [all] Error 2

any idea? thanks a lot ^_^

@flowirin
Copy link

flowirin commented Oct 5, 2016

try compiling with -fPIC ?

flow ir in

On 5 October 2016 at 14:09, EmpireofQin notifications@github.com wrote:

i run into this problem:

[ 88%] Building CXX object src/caffe/CMakeFiles/caffe.dir/layer.cpp.o
Linking CXX shared library ../../lib/libcaffe-d.so
/usr/bin/ld: /usr/local/lib/libcblas.a(cblas_sgemv.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libcblas.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libcaffe-d.so.1.0.0-rc3] Error 1
make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
make: *** [all] Error 2

any idea? thanks a lot ^_^


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1667 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AMnuraAjwwK-tenDParQaW62SaK6K9SDks5qwvjOgaJpZM4DNzQk
.

@gaopinghai
Copy link

I have tried this, but dosen't work

@flowirin
Copy link

flowirin commented Oct 7, 2016

what is the error?

flow ir in

On 7 October 2016 at 14:21, EmpireofQin notifications@github.com wrote:

I have tried this, but dosen't work


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1667 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AMnurS7qJtoWVIRYoxcLhnEwHTZbCMnMks5qxZ6KgaJpZM4DNzQk
.

@gaopinghai
Copy link

gaopinghai commented Oct 7, 2016

I have solved this problem. I tried to edit CMakeCache.txt in the build file and changed

//Path to a library.
Atlas_CBLAS_LIBRARY:FILEPATH=<path to libcblas.a>

into

//Path to a library.
Atlas_CBLAS_LIBRARY:FILEPATH=/usr/lib/libcblas.so //<path to libcblas.so in my machine>

and it works.
i suppose it is because i have tried to install atlas things to many times LOL
thanks a lot @flowirin

@YinHT2016
Copy link

@riteshpradh
hi,I met the same question as yours,could you share the solution?thanks a lot.
my email is 714789880@qq.com

@YinHT2016
Copy link

@longjon
hi,there is a question I met:
make symlink
make: *** No rule to make targetsymlink'. Stop.`
I am lack of experience on the CMake and Linux ,could you tell me what shoud I do ?
Thanks a lot.

@gaopinghai
Copy link

gaopinghai commented Oct 31, 2016

Hi, I have error like this:

CMake Error at CMakeLists.txt:83 (add_dependencies):
  The dependency target "pycaffe" of target "pytest" does not exist.

I can still do next steps to finish compiling. What should I do to solve this error?
Hoping to get help, thanks a lot! ^_^

@viscropst
Copy link

Who can tell me how to use intel mkl to compile caffe with cmake????

@seeocean2000
Copy link

@viscropst In case you are still wondering, to build w/ Intel MLK, you can do the following:
cmake -DBLAS=MLK ..
I haven't tried MLK specifically, but BLAS=Open works for me (for OpenBLAS). Take a look at the file cmake/Dependencies.cmake.

@toniiism
Copy link

Compilation crushed on the following errors. Can anyone help?
I am now compiling within fast-rcnn subdirectory

CXX/LD -o .build_release/tools/extract_features.bin
.build_release/lib/libcaffe.so: undefined reference to mdb_txn_begin' .build_release/lib/libcaffe.so: undefined reference to mdb_cursor_get'
.build_release/lib/libcaffe.so: undefined reference to mdb_cursor_close' .build_release/lib/libcaffe.so: undefined reference to mdb_put'
.build_release/lib/libcaffe.so: undefined reference to leveldb::WriteBatch::WriteBatch()' .build_release/lib/libcaffe.so: undefined reference to mdb_txn_abort'
.build_release/lib/libcaffe.so: undefined reference to mdb_strerror' .build_release/lib/libcaffe.so: undefined reference to mdb_txn_commit'
.build_release/lib/libcaffe.so: undefined reference to mdb_env_open' .build_release/lib/libcaffe.so: undefined reference to mdb_cursor_open'
.build_release/lib/libcaffe.so: undefined reference to mdb_env_set_mapsize' .build_release/lib/libcaffe.so: undefined reference to mdb_dbi_close'
.build_release/lib/libcaffe.so: undefined reference to leveldb::Status::ToString[abi:cxx11]() const' .build_release/lib/libcaffe.so: undefined reference to mdb_env_create'
.build_release/lib/libcaffe.so: undefined reference to leveldb::WriteBatch::~WriteBatch()' .build_release/lib/libcaffe.so: undefined reference to leveldb::Options::Options()'
.build_release/lib/libcaffe.so: undefined reference to mdb_env_close' .build_release/lib/libcaffe.so: undefined reference to leveldb::DB::Open(leveldb::Options const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, leveldb::DB**)'
.build_release/lib/libcaffe.so: undefined reference to mdb_dbi_open' .build_release/lib/libcaffe.so: undefined reference to leveldb::WriteBatch::Put(leveldb::Slice const&, leveldb::Slice const&)'
collect2: error: ld returned 1 exit status
makefile:547: recipe for target '.build_release/tools/extract_features.bin' failed
make: *** [.build_release/tools/extract_features.bin] Error 1

@xiaowugegeya
Copy link

can anyone help me with this problem when I "make runtest"?

[----------] Global test environment tear-down
[==========] 1104 tests from 150 test cases ran. (130644 ms total)
[ PASSED ] 1103 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] NeuronLayerTest/0.TestPReLUForward, where TypeParam = caffe::CPUDevice

1 FAILED TEST
src/caffe/test/CMakeFiles/runtest.dir/build.make:57: recipe for target 'src/caffe/test/CMakeFiles/runtest' failed
make[3]: *** [src/caffe/test/CMakeFiles/runtest] Error 1
CMakeFiles/Makefile2:362: recipe for target 'src/caffe/test/CMakeFiles/runtest.dir/all' failed
make[2]: *** [src/caffe/test/CMakeFiles/runtest.dir/all] Error 2
CMakeFiles/Makefile2:369: recipe for target 'src/caffe/test/CMakeFiles/runtest.dir/rule' failed
make[1]: *** [src/caffe/test/CMakeFiles/runtest.dir/rule] Error 2
Makefile:253: recipe for target 'runtest' failed
make: *** [runtest] Error 2

@Soda-Wong
Copy link

@InfiniteLifeH have you succeed in windows?

@fengfan028
Copy link

Can anyone help me with this problem when I "make install"? Thanks a lot.

CMake Error at python/cmake_install.cmake:59 (file):
file RPATH_CHANGE could not write new RPATH:

/home/lab302/caffe/cmake_build/install/lib:/usr/local/cuda-8.0/lib64:/usr/lib/x86_64-linux-gnu/hdf5/serial/lib:/home/lab302/opencv-3.1.0/release/lib

to the file:

/home/lab302/caffe/cmake_build/install/python/caffe/_caffe.so

The current RPATH is:

$ORIGIN/../../build/lib

which does not contain:

/usr/local/cuda-8.0/lib64:/home/lab302/caffe/cmake_build/lib:/usr/lib/x86_64-linux-gnu/hdf5/serial/lib:/home/lab302/opencv-3.1.0/release/lib::::::::

as was expected.
Call Stack (most recent call first):
cmake_install.cmake:64 (include)

Makefile:61: recipe for target 'install' failed
make: *** [install] Error 1

@EgorAntonovich
Copy link

how can i change CPU_ONLY :OFF to CPU_ONLY:ON before make cmake.. ???

@seeocean2000
Copy link

seeocean2000 commented Nov 14, 2017 via email

@Hiker01
Copy link

Hiker01 commented Mar 13, 2019

I have made caffe with cmake, however when I try to make pycaffe, all the file installed in my directory:build/install disappear. Can anybody help me ?

@youthM
Copy link

youthM commented Dec 2, 2019

I met the problem
make: *** No rule to make target '/usr/local/cuda/include/thrust/detail/alignment.h', needed by '.build_release/cuda/src/caffe/layers/softmax_layer.o' stop. Can anybody help me ?

@Hassan313
Copy link

Hi I am trying to install the https://github.com/microideax/Quantization-caffe repository, which have referred to follow what has been said here. However, I am getting the below error:
/home/hassan/Quantization/Quantization-caffe/src/caffe/blob.cpp: In instantiation of ‘void caffe::Blob::clip_data(caffe::Phase, caffe::CompressParameter, std::string) [with Dtype = float; std::string = std::_cxx11::basic_string]’:
/home/hassan/Quantization/Quantization-caffe/src/caffe/blob.cpp:1425:1: required from here
/home/hassan/Quantization/Quantization-caffe/src/caffe/blob.cpp:783:24: error: ‘caffe_cpu_quantizec’ was not declared in this scope; did you mean ‘set_cpu_quantize’?
783 | caffe_cpu_quantizec(this->count(), this->cpu_data(),this->mutable_cpu_data(),&this->alpha
, max_bits);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| set_cpu_quantize

Can anyone help me with this?

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet