I have installed everything and am trying to compile 'make run_single_zone' and am receiving errors (OS X 10.11.6, XCode 7.3.1). I have seen this blog post and if I compile with clang or gcc I receive similar errors, the last few lines being:
In file included from ../../nnt/auxiliary.cpp:29:
In file included from ../../nnt/auxiliary.h:39:
In file included from /opt/local/include/boost/lexical_cast.hpp:32:
In file included from /opt/local/include/boost/lexical_cast/try_lexical_convert.hpp:35:
In file included from /opt/local/include/boost/lexical_cast/detail/converter_lexical.hpp:54:
/opt/local/include/boost/lexical_cast/detail/converter_lexical_streams.hpp:210:17: error:
unused typedef 'boost_static_assert_typedef_212' [-Werror,-Wunused-local-typedef]
BOOST_STATIC_ASSERT_MSG(( sizeof(T) <= sizeof(CharT)),
^
/opt/local/include/boost/static_assert.hpp:36:48: note: expanded from macro
'BOOST_STATIC_ASSERT_MSG'
define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B )
^
/opt/local/include/boost/static_assert.hpp:170:16: note: expanded from macro
'BOOST_STATIC_ASSERT'
BOOST_JOIN(boost_static_assert_typedef_, LINE) BOOST_...
^
/opt/local/include/boost/config/suffix.hpp:544:28: note: expanded from macro
'BOOST_JOIN'
define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y )
^
/opt/local/include/boost/config/suffix.hpp:545:31: note: expanded from macro
'BOOST_DO_JOIN'
define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y)
^
/opt/local/include/boost/config/suffix.hpp:546:32: note: expanded from macro
'BOOST_DO_JOIN2'
define BOOST_DO_JOIN2( X, Y ) X##Y
^
<scratch space="">:116:1: note: expanded from here
boost_static_assert_typedef_212
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [../../obj/auxiliary.o] Error 1
Please let me know what I can do to fix this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It looks like you are compiling with clang and that clang is not ignoring the warnings as errors. An immediate fix is to change the lines in nucnet-tools-code/build/Makefile from
and try remaking. That will force clang to use the warning. The make file should be performing the clang test correctly, but maybe there is something off in your installation. If you are using clang, I'd be interested in knowing what the result of
gcc -v 2>&1 > /dev/null | grep clang
is. It should give something like
Apple LLVM version 7.3.0 (clang-703.0.29)
Another fix is to update boost as in the blog post you note. You don't need to compile the library or change to gcc. Once you've cloned boost, keep clang and type
export BOOST_DIR=/Users/bradleymeyer/boost
(of course using your directory for the installed boost instead of mine). Then remake the code. The version of boost you check out with git will have the unused local typedef errors fixed.
A third point is that gcc should not give this problem. I've not seen gcc complain about the Boost unused local typedefs. You might check that you've carried out the gcc steps carefully. Let me know what you try and how it turns out. Best wishes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for your assistance and very fast response time! I managed to resolve the issue by removing GC = clang++ from the examples/network/Makefile. I had forgotten to remove it when attempting to find a solution. The code is working fully on my computer now.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Glad to hear it. Yes, that line GC = clang++ was only to get the code to compile the c++ part with clang and the fortran with gfortran. It's probably best for now to compile code that needs both c++ and fortran with GNU gcc only. Again, for mac users who want to use both clang and gcc, for now I recommend the steps in this post.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your post. libxml updated their xmlStrPrintf format statement which can cause a conflict depending on how up to date your libxml version is and how it was patched. You should be able to do the following (in bash):
cd nucnet-tools-code/examples/network/
export WN_XML_CHAR=xmlChar
make clean
make run_entropy
The environment variable WN_XML_CHAR sets the format string. The possible values are char and xmlChar, and the code usually chooses between them correctly depending on the version of libxml it detects. Sometimes, however, there's a mismatch and you have to set by hand as above. If the above doesn't work, try
export WN_XML_CHAR=char
make clean
make run_entropy
If one of these works, you can set WN_XML_CHAR in your .bashrc file. I hope this helps. Best wishes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear Brad,
Thanks very mcuh, I have done that as you wrote above and export WN_XML_CHAR=char works for me.
But another problem come as follows:
run_entropy.cpp:32:36: error: boost/numeric/odeint.hpp: No such file or directory
run_entropy.cpp: In function 'int main(int, char)':
run_entropy.cpp:653: error: 'boost::numeric' has not been declared
run_entropy.cpp:653: error: expected primary-expression before '>' token
run_entropy.cpp:653: error: 'stepper' was not declared in this scope
make: * [run_entropy] Error 1
Make failed. Contact project maintainer.
I tried to reinstall the boost and it still come out with the same error.
Thanks very much.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2021-01-28
Hello prof .Bradley S. Meyer
I have installed everything and am trying to compile 'make run_single_zone' and am receiving errors
/bin/sh: 1: xsltproc: not found
tar xz -C ../../vendor -f ../../vendor/wn_matrix.tar.gz
g++ -Werror -Wall -Wpointer-arith -Wwrite-strings -fno-common -g -O0 -fopenmp -Wno-deprecated -DHYDRO_EXP_EXPANSION xml2-config --cflagsgsl-config --cflags -I../../vendor/libnucnet/0.40/src -I../../vendor/wn_matrix/0.19/src -I../../vendor/libstatmech/0.10/src -I../../vendor/libnuceq/0.7/src -I../.. -I ../../vendor/wn_sparse_solve/0.7/src -c ../../vendor/wn_matrix/0.19/src/WnMatrix.c -o ../../obj/WnMatrix.o
/bin/sh: 1: xml2-config: not found
/bin/sh: 1: gsl-config: not found
In file included from ../../vendor/wn_matrix/0.19/src/WnMatrix.c:40:0:
../../vendor/wn_matrix/0.19/src/WnMatrix.h:49:25: fatal error: libxml/hash.h: No such file or directory
#include <libxml hash.h="">
^
compilation terminated.
make: *** [../../obj/WnMatrix.o] Error 1</libxml>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Hello,
I have installed everything and am trying to compile 'make run_single_zone' and am receiving errors (OS X 10.11.6, XCode 7.3.1). I have seen this blog post and if I compile with clang or gcc I receive similar errors, the last few lines being:
In file included from ../../nnt/auxiliary.cpp:29:
In file included from ../../nnt/auxiliary.h:39:
In file included from /opt/local/include/boost/lexical_cast.hpp:32:
In file included from /opt/local/include/boost/lexical_cast/try_lexical_convert.hpp:35:
In file included from /opt/local/include/boost/lexical_cast/detail/converter_lexical.hpp:54:
/opt/local/include/boost/lexical_cast/detail/converter_lexical_streams.hpp:210:17: error:
unused typedef 'boost_static_assert_typedef_212'
[-Werror,-Wunused-local-typedef]
BOOST_STATIC_ASSERT_MSG(( sizeof(T) <= sizeof(CharT)),
^
/opt/local/include/boost/static_assert.hpp:36:48: note: expanded from macro
'BOOST_STATIC_ASSERT_MSG'
define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B )
/opt/local/include/boost/static_assert.hpp:170:16: note: expanded from macro
'BOOST_STATIC_ASSERT'
BOOST_JOIN(boost_static_assert_typedef_, LINE) BOOST_...
^
/opt/local/include/boost/config/suffix.hpp:544:28: note: expanded from macro
'BOOST_JOIN'
define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y )
/opt/local/include/boost/config/suffix.hpp:545:31: note: expanded from macro
'BOOST_DO_JOIN'
define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y)
/opt/local/include/boost/config/suffix.hpp:546:32: note: expanded from macro
'BOOST_DO_JOIN2'
define BOOST_DO_JOIN2( X, Y ) X##Y
<scratch space="">:116:1: note: expanded from here
boost_static_assert_typedef_212
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [../../obj/auxiliary.o] Error 1
Please let me know what I can do to fix this.
It looks like you are compiling with clang and that clang is not ignoring the warnings as errors. An immediate fix is to change the lines in nucnet-tools-code/build/Makefile from
to
and try remaking. That will force clang to use the warning. The make file should be performing the clang test correctly, but maybe there is something off in your installation. If you are using clang, I'd be interested in knowing what the result of
gcc -v 2>&1 > /dev/null | grep clang
is. It should give something like
Another fix is to update boost as in the blog post you note. You don't need to compile the library or change to gcc. Once you've cloned boost, keep clang and type
export BOOST_DIR=/Users/bradleymeyer/boost
(of course using your directory for the installed boost instead of mine). Then remake the code. The version of boost you check out with git will have the unused local typedef errors fixed.
A third point is that gcc should not give this problem. I've not seen gcc complain about the Boost unused local typedefs. You might check that you've carried out the gcc steps carefully. Let me know what you try and how it turns out. Best wishes.
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Thank you for your assistance and very fast response time! I managed to resolve the issue by removing GC = clang++ from the examples/network/Makefile. I had forgotten to remove it when attempting to find a solution. The code is working fully on my computer now.
Glad to hear it. Yes, that line GC = clang++ was only to get the code to compile the c++ part with clang and the fortran with gfortran. It's probably best for now to compile code that needs both c++ and fortran with GNU gcc only. Again, for mac users who want to use both clang and gcc, for now I recommend the steps in this post.
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Hello, Brad,
I have a problem for the make run_entropy as below:
What is the possible problenm for this?
Thanks very much.
network]$ make run_entropy
tar xz -C ../../vendor -f ../../vendor/wn_matrix.tar.gz
g++ -Werror -Wall -Wpointer-arith -Wwrite-strings -fshort-enums -fno-common -g -O0 -fopenmp -Wno-deprecated -DHYDRO_EXP_EXPANSION -I/home/zhuang/boost
xml2-config --cflags
gsl-config --cflags
-I../../vendor/libnucnet/0.28/src -I../../vendor/wn_matrix/0.18/src -I../../vendor/libstatmech/0.10/src -I../../vendor/libnuceq/0.7/src -I../.. -I ../../vendor/wn_sparse_solve/0.6/src -c ../../vendor/wn_matrix/0.18/src/WnMatrix.c -o ../../obj/WnMatrix.o../../vendor/wn_matrix/0.18/src/WnMatrix.c: In function 'int WnMatrixassignElement(WnMatrix, size_t, size_t, double)':
../../vendor/wn_matrix/0.18/src/WnMatrix.c:130: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:130: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:131: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:131: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char*, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c: In function 'int WnMatrixupdateElement(WnMatrix, size_t, size_t, double)':
../../vendor/wn_matrix/0.18/src/WnMatrix.c:244: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:244: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:245: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:245: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c: In function 'int WnMatrixremoveElement(WnMatrix, size_t, size_t)':
../../vendor/wn_matrix/0.18/src/WnMatrix.c:282: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:282: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:283: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:283: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char*, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c: In function 'double WnMatrixgetElement(WnMatrix, size_t, size_t)':
../../vendor/wn_matrix/0.18/src/WnMatrix.c:322: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:322: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:323: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:323: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c: In function 'WnMatrixLine* WnMatrixgetRow(WnMatrix, size_t)':
../../vendor/wn_matrix/0.18/src/WnMatrix.c:1044: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:1044: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c: In function 'WnMatrixLine* WnMatrixgetColumn(WnMatrix, size_t)':
../../vendor/wn_matrix/0.18/src/WnMatrix.c:1108: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:1108: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c: In function 'xmlDoc WnMatrixCoomakeXmlDocument(WnMatrixCoo, const WnChar)':
../../vendor/wn_matrix/0.18/src/WnMatrix.c:1903: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:1903: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:1920: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:1920: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:1937: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:1937: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c: In function 'xmlDoc* WnMatrixCsrmakeXmlDocument(WnMatrixCsr, const WnChar)':
../../vendor/wn_matrix/0.18/src/WnMatrix.c:2095: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:2095: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:2140: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:2140: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:2157: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:2157: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c: In function 'xmlDoc WnMatrixYalemakeXmlDocument(WnMatrixYale, const WnChar)':
../../vendor/wn_matrix/0.18/src/WnMatrix.c:2320: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:2320: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:2337: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:2337: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
../../vendor/wn_matrix/0.18/src/WnMatrix.c: In function 'xmlDoc* WnMatrixmake_gsl_vector_xml_document(gsl_vector, const WnChar)':
../../vendor/wn_matrix/0.18/src/WnMatrix.c:2899: error: invalid conversion from 'const WnChar' to 'const char'
../../vendor/wn_matrix/0.18/src/WnMatrix.c:2899: error: initializing argument 3 of 'int xmlStrPrintf(xmlChar, int, const char, ...)'
make: *** [../../obj/WnMatrix.o] Error 1
Thanks for your post. libxml updated their xmlStrPrintf format statement which can cause a conflict depending on how up to date your libxml version is and how it was patched. You should be able to do the following (in bash):
cd nucnet-tools-code/examples/network/
export WN_XML_CHAR=xmlChar
make clean
make run_entropy
The environment variable WN_XML_CHAR sets the format string. The possible values are char and xmlChar, and the code usually chooses between them correctly depending on the version of libxml it detects. Sometimes, however, there's a mismatch and you have to set by hand as above. If the above doesn't work, try
export WN_XML_CHAR=char
make clean
make run_entropy
If one of these works, you can set WN_XML_CHAR in your .bashrc file. I hope this helps. Best wishes.
View and moderate all "Getting Help with Nucnet Tools" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Dear Brad,
Thanks very mcuh, I have done that as you wrote above and export WN_XML_CHAR=char works for me.
But another problem come as follows:
run_entropy.cpp:32:36: error: boost/numeric/odeint.hpp: No such file or directory
run_entropy.cpp: In function 'int main(int, char)':
run_entropy.cpp:653: error: 'boost::numeric' has not been declared
run_entropy.cpp:653: error: expected primary-expression before '>' token
run_entropy.cpp:653: error: 'stepper' was not declared in this scope
make: * [run_entropy] Error 1
Make failed. Contact project maintainer.
I tried to reinstall the boost and it still come out with the same error.
Thanks very much.
I've moved this to a new thread.
Hello prof .Bradley S. Meyer
I have installed everything and am trying to compile 'make run_single_zone' and am receiving errors
/bin/sh: 1: xsltproc: not found
tar xz -C ../../vendor -f ../../vendor/wn_matrix.tar.gz
g++ -Werror -Wall -Wpointer-arith -Wwrite-strings -fno-common -g -O0 -fopenmp -Wno-deprecated -DHYDRO_EXP_EXPANSION
xml2-config --cflags
gsl-config --cflags
-I../../vendor/libnucnet/0.40/src -I../../vendor/wn_matrix/0.19/src -I../../vendor/libstatmech/0.10/src -I../../vendor/libnuceq/0.7/src -I../.. -I ../../vendor/wn_sparse_solve/0.7/src -c ../../vendor/wn_matrix/0.19/src/WnMatrix.c -o ../../obj/WnMatrix.o/bin/sh: 1: xml2-config: not found
/bin/sh: 1: gsl-config: not found
In file included from ../../vendor/wn_matrix/0.19/src/WnMatrix.c:40:0:
../../vendor/wn_matrix/0.19/src/WnMatrix.h:49:25: fatal error: libxml/hash.h: No such file or directory
#include <libxml hash.h="">
^
compilation terminated.
make: *** [../../obj/WnMatrix.o] Error 1</libxml>
My apologies for the delayed response. It seems you have not installed a number of the key libraries (libxslt, libxml2, gsl). You should install those (see: https://sourceforge.net/u/mbradle/blog/2017/07/installing-linux-libraries-for-nucnet-tools-and-related-codes/). Alternatively, you might find it easier to use Docker. See https://github.com/mbradle/docker_single_zone. I hope that helps. Let me know if not.