Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Build fail with Mac OS X (Yosemite, gcc 4.9 from homebrew with openMP, open CV, Blas) #192

Closed
phunterlau opened this issue Sep 30, 2015 · 15 comments

Comments

@phunterlau
Copy link
Contributor

After following the build instruction by checking out the latest mxnet recursively, and installing c++, open cv, open blas, make gives this error on isnan in the ndarray_function from mshadow (latest mxnet commit 6155880 ):

g++ -std=c++0x -DMSHADOW_FORCE_STREAM -Wall -O3 -I./mshadow/ -I./dmlc-core/include -fPIC -Iinclude -msse3 -funroll-loops -Wno-unused-parameter -Wno-unknown-pragmas -DMSHADOW_USE_CUDA=0 -DMSHADOW_USE_CBLAS=1 -DMSHADOW_USE_MKL=0 -DMSHADOW_RABIT_PS=0 -DMSHADOW_DIST_PS=0 -DMXNET_USE_OPENCV=1 -fopenmp  -MM -MT build/ndarray/ndarray.o src/ndarray/ndarray.cc >build/ndarray/ndarray.d
g++ -std=c++0x -c -DMSHADOW_FORCE_STREAM -Wall -O3 -I./mshadow/ -I./dmlc-core/include -fPIC -Iinclude -msse3 -funroll-loops -Wno-unused-parameter -Wno-unknown-pragmas -DMSHADOW_USE_CUDA=0 -DMSHADOW_USE_CBLAS=1 -DMSHADOW_USE_MKL=0 -DMSHADOW_RABIT_PS=0 -DMSHADOW_DIST_PS=0 -DMXNET_USE_OPENCV=1 -fopenmp  -c src/ndarray/ndarray.cc -o build/ndarray/ndarray.o
In file included from src/ndarray/ndarray.cc:13:0:
src/ndarray/./ndarray_function.h: In static member function 'static mxnet::real_t mxnet::ndarray::Clip::mshadow_op::Map(mxnet::real_t, mxnet::real_t)':
src/ndarray/./ndarray_function.h:43:18: error: 'isnan' was not declared in this scope
       if (isnan(a)) return 0.0f;
                  ^
src/ndarray/./ndarray_function.h:43:18: note: suggested alternative:
In file included from /usr/local/Cellar/gcc49/4.9.3/include/c++/4.9.3/random:38:0,
                 from /usr/local/Cellar/gcc49/4.9.3/include/c++/4.9.3/bits/stl_algo.h:66,
                 from /usr/local/Cellar/gcc49/4.9.3/include/c++/4.9.3/algorithm:62,
                 from ./dmlc-core/include/dmlc/./parameter.h:18,
                 from ./dmlc-core/include/dmlc/registry.h:14,
                 from src/ndarray/ndarray.cc:8:
/usr/local/Cellar/gcc49/4.9.3/include/c++/4.9.3/cmath:632:5: note:   'std::isnan'
     isnan(_Tp __x)
     ^
In file included from src/ndarray/ndarray.cc:8:0:
src/ndarray/ndarray.cc: At global scope:
./dmlc-core/include/dmlc/registry.h:194:22: warning: 'mxnet::__make_NDArrayFunctionReg__set_value__' defined but not used [-Wunused-variable]
   static EntryType & __make_ ## EntryTypeName ## _ ## Name ## __ =      \
                      ^
include/mxnet/ndarray.h:580:3: note: in expansion of macro 'DMLC_REGISTRY_REGISTER'
   DMLC_REGISTRY_REGISTER(::mxnet::NDArrayFunctionReg, NDArrayFunctionReg, name)
   ^
src/ndarray/ndarray.cc:508:1: note: in expansion of macro 'MXNET_REGISTER_NDARRAY_FUN'
 MXNET_REGISTER_NDARRAY_FUN(_set_value).set_function(SetValueOp);
 ^

Can you suggest some fix so I can test on my mac? Thanks.

@antinucleon
Copy link
Contributor

trystd::isnan?

@tqchen
Copy link
Member

tqchen commented Sep 30, 2015

add using namespace std should work, @antinucleon I think we want to remove isnan check

@tqchen
Copy link
Member

tqchen commented Sep 30, 2015

We cannot do std::isnan because that code is supposed to run on CUDA as well

@antinucleon
Copy link
Contributor

k...will remove nan check

@mli
Copy link
Member

mli commented Oct 9, 2015

that happens before. Can we auto pick the right isnan based on the device?

@antinucleon
Copy link
Contributor

I removed isnan already
On Fri, Oct 9, 2015 at 00:51 Mu Li [email protected] wrote:

that happens before. Can we auto pick the right isnan based on the device?


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

@pluskid
Copy link
Contributor

pluskid commented Oct 9, 2015

Also just a side note for OSX compilation: if we add -I/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers/ to ADD_CFLAGS then there is no need to install third-party BLAS.

@tqchen
Copy link
Member

tqchen commented Oct 9, 2015

Yes, this is already enabled by setting USE_BLAS=apple @antinucleon We should add that in build note for OSX

@pluskid
Copy link
Contributor

pluskid commented Oct 9, 2015

@tqchen Thanks! Good to know that. I think it is definitely good to have recommended ways of installing the dependency packages on Linux and OS X separately in the INSTALL document.

@phunterlau
Copy link
Contributor Author

@pluskid After upgrading to El Capitan, this default BLAS from apple has just gone, if you need BLAS, don't upgrade :-) Meanwhile, I am trying to find a way to have BLAS in the new system

@pluskid
Copy link
Contributor

pluskid commented Oct 9, 2015

@phunterlau I still have them in the original place after upgrading to EI Capitan.

@mli
Copy link
Member

mli commented Oct 10, 2015

my suggestion is USE_BLAS=AUTO in default

if osx, then set it to apple, otherwise probably just blas, or auto check what is available.

@pluskid
Copy link
Contributor

pluskid commented Oct 10, 2015

I second the idea for "auto" BLAS. I saw cmake related stuff in the repo recently. Are we going to switch to cmake soon?

@tqchen
Copy link
Member

tqchen commented Oct 10, 2015

the cmake is already ready to use. I think we will keep both approaches ,
both Makefile and cmake. Cmake is good for windows and being auto in
choosing libs. Except that itself is a dependency.
On Sat, Oct 10, 2015 at 11:38 AM Chiyuan Zhang [email protected]
wrote:

I second the idea for "auto" BLAS. I saw cmake related stuff in the repo
recently. Are we going to switch to cmake soon?


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

@phunterlau
Copy link
Contributor Author

fixed my local BLAS installation from upgrading to El Capitan. Compiled and tested OK after fixing nan problem. I am trying to finish the pip installation soon.

stefanhenneking pushed a commit to stefanhenneking/mxnet that referenced this issue Jun 30, 2017
eric-haibin-lin added a commit that referenced this issue Jan 28, 2018
* bump

* also update base.h

* revert website changes

* Update index.html
eric-haibin-lin added a commit that referenced this issue Jan 28, 2018
* bump

* also update base.h

* revert website changes

* Update index.html
szha pushed a commit that referenced this issue Feb 6, 2018
* Bump 1.1 (#192)

* bump

* also update base.h

* revert website changes

* Update index.html

* revert mxnet-theme/index.html changes

* remove empty line
iblislin pushed a commit to iblislin/incubator-mxnet that referenced this issue Mar 18, 2018
remove BaseTestNext and bump Compat
eric-haibin-lin added a commit that referenced this issue Mar 27, 2018
* Bump 1.1 (#192)

* bump

* also update base.h

* revert website changes

* Update index.html

* update news.md (#191)

* Update NEWS.md

* Update README.md

* refactor regression ops to nnvm interface (#9540)

* refactor regression ops

* fix err for instantiation of minus_sign

* remove useless header file init_op.h

* replace with macro and address other comments

* update

* minor revise docs

* add mae test

* Update KEYS

* Update NEWS.md

* fixed links that were missng ndarray folder path (#9618)

* Fixed 4 broken links (#9698)

* Fixed 4 broken links

* fixed pylint for long line disable and 1 broken link

* Update NEWS.md

* Update NOTICE (#9706)

* revert acc changes (#9731)

* Revert "avoid per-batch blocking in metric (#9636)"

This reverts commit 3fe694e.

* Revert "proper flatten in acc (#9619)"

This reverts commit ed823b2.

* Revert "use nd for accuracy calculation (#9583)"

This reverts commit f5f1b91.

* keep doc change

* PGP keys add liuyizhi AT apache.org (#9728)

* Add my key (#9736)

* [REVIEW REQUIRED] Revert PR #9484 & add additional dependency licenses to LICENSE file (#9701)

* Revert "[Review Required] Fixing Licenses: Cleaning up the Top Level LICENSE file (#9484)"

This reverts commit 8930d96.

* Some more LICENSE fixes

* Adding some more packages to the LICENSE file

* Adding dependencies of dependencies

* update navbar model zoo link (#9749)

* update navbar model zoo link

* update

* initial commit

* clean up

* refactor

* fix test
jinhuang415 pushed a commit to jinhuang415/incubator-mxnet that referenced this issue Mar 30, 2018
* Bump 1.1 (apache#192)

* bump

* also update base.h

* revert website changes

* Update index.html

* update news.md (apache#191)

* Update NEWS.md

* Update README.md

* refactor regression ops to nnvm interface (apache#9540)

* refactor regression ops

* fix err for instantiation of minus_sign

* remove useless header file init_op.h

* replace with macro and address other comments

* update

* minor revise docs

* add mae test

* Update KEYS

* Update NEWS.md

* fixed links that were missng ndarray folder path (apache#9618)

* Fixed 4 broken links (apache#9698)

* Fixed 4 broken links

* fixed pylint for long line disable and 1 broken link

* Update NEWS.md

* Update NOTICE (apache#9706)

* revert acc changes (apache#9731)

* Revert "avoid per-batch blocking in metric (apache#9636)"

This reverts commit 3fe694e.

* Revert "proper flatten in acc (apache#9619)"

This reverts commit ed823b2.

* Revert "use nd for accuracy calculation (apache#9583)"

This reverts commit f5f1b91.

* keep doc change

* PGP keys add liuyizhi AT apache.org (apache#9728)

* Add my key (apache#9736)

* [REVIEW REQUIRED] Revert PR apache#9484 & add additional dependency licenses to LICENSE file (apache#9701)

* Revert "[Review Required] Fixing Licenses: Cleaning up the Top Level LICENSE file (apache#9484)"

This reverts commit 8930d96.

* Some more LICENSE fixes

* Adding some more packages to the LICENSE file

* Adding dependencies of dependencies

* update navbar model zoo link (apache#9749)

* update navbar model zoo link

* update

* initial commit

* clean up

* refactor

* fix test
rahul003 pushed a commit to rahul003/mxnet that referenced this issue Jun 4, 2018
* Bump 1.1 (apache#192)

* bump

* also update base.h

* revert website changes

* Update index.html

* revert mxnet-theme/index.html changes

* remove empty line
rahul003 pushed a commit to rahul003/mxnet that referenced this issue Jun 4, 2018
* Bump 1.1 (apache#192)

* bump

* also update base.h

* revert website changes

* Update index.html

* update news.md (apache#191)

* Update NEWS.md

* Update README.md

* refactor regression ops to nnvm interface (apache#9540)

* refactor regression ops

* fix err for instantiation of minus_sign

* remove useless header file init_op.h

* replace with macro and address other comments

* update

* minor revise docs

* add mae test

* Update KEYS

* Update NEWS.md

* fixed links that were missng ndarray folder path (apache#9618)

* Fixed 4 broken links (apache#9698)

* Fixed 4 broken links

* fixed pylint for long line disable and 1 broken link

* Update NEWS.md

* Update NOTICE (apache#9706)

* revert acc changes (apache#9731)

* Revert "avoid per-batch blocking in metric (apache#9636)"

This reverts commit 3fe694e.

* Revert "proper flatten in acc (apache#9619)"

This reverts commit ed823b2.

* Revert "use nd for accuracy calculation (apache#9583)"

This reverts commit f5f1b91.

* keep doc change

* PGP keys add liuyizhi AT apache.org (apache#9728)

* Add my key (apache#9736)

* [REVIEW REQUIRED] Revert PR apache#9484 & add additional dependency licenses to LICENSE file (apache#9701)

* Revert "[Review Required] Fixing Licenses: Cleaning up the Top Level LICENSE file (apache#9484)"

This reverts commit 8930d96.

* Some more LICENSE fixes

* Adding some more packages to the LICENSE file

* Adding dependencies of dependencies

* update navbar model zoo link (apache#9749)

* update navbar model zoo link

* update

* initial commit

* clean up

* refactor

* fix test
zheng-da pushed a commit to zheng-da/incubator-mxnet that referenced this issue Jun 28, 2018
* Bump 1.1 (apache#192)

* bump

* also update base.h

* revert website changes

* Update index.html

* revert mxnet-theme/index.html changes

* remove empty line
zheng-da pushed a commit to zheng-da/incubator-mxnet that referenced this issue Jun 28, 2018
* Bump 1.1 (apache#192)

* bump

* also update base.h

* revert website changes

* Update index.html

* update news.md (apache#191)

* Update NEWS.md

* Update README.md

* refactor regression ops to nnvm interface (apache#9540)

* refactor regression ops

* fix err for instantiation of minus_sign

* remove useless header file init_op.h

* replace with macro and address other comments

* update

* minor revise docs

* add mae test

* Update KEYS

* Update NEWS.md

* fixed links that were missng ndarray folder path (apache#9618)

* Fixed 4 broken links (apache#9698)

* Fixed 4 broken links

* fixed pylint for long line disable and 1 broken link

* Update NEWS.md

* Update NOTICE (apache#9706)

* revert acc changes (apache#9731)

* Revert "avoid per-batch blocking in metric (apache#9636)"

This reverts commit 3fe694e.

* Revert "proper flatten in acc (apache#9619)"

This reverts commit ed823b2.

* Revert "use nd for accuracy calculation (apache#9583)"

This reverts commit f5f1b91.

* keep doc change

* PGP keys add liuyizhi AT apache.org (apache#9728)

* Add my key (apache#9736)

* [REVIEW REQUIRED] Revert PR apache#9484 & add additional dependency licenses to LICENSE file (apache#9701)

* Revert "[Review Required] Fixing Licenses: Cleaning up the Top Level LICENSE file (apache#9484)"

This reverts commit 8930d96.

* Some more LICENSE fixes

* Adding some more packages to the LICENSE file

* Adding dependencies of dependencies

* update navbar model zoo link (apache#9749)

* update navbar model zoo link

* update

* initial commit

* clean up

* refactor

* fix test
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants