Bug #1507
closedBuild error on FreeBSD 10.0 32-bit
0%
Description
Dependencies were installed with:
sudo pkg install devel/boost-all security/cryptopp databases/sqlite3 net/libpcap
Environment:
[sjx@a ~]$ uname -a
FreeBSD a.freebsd.ndn-routing.emulab.net 10.0-CURRENT FreeBSD 10.0-CURRENT #1 r254898: Mon Aug 26 17:35:52 MDT 2013 root@node.freebsd10-node.testbed.emulab.net:/usr/obj/repos/src/sys/TESTBED-GENERIC-POLLING-NODEBUG i386
[sjx@a ~]$ pkg version | grep -E 'boost-all|cryptopp|sqlite3|libpcap'
boost-all-1.55.0 =
cryptopp-5.6.2_1 =
libpcap-1.5.2 =
sqlite3-3.8.4.2 =
[sjx@a ~]$ g++ -v
Using built-in specs.
Target: i386-undermydesk-freebsd
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 4.2.1 20070831 patched [FreeBSD]
Build error:
[37/72] cxxprogram: build/tools/ndncatchunks3.cpp.1.o -> build/tools/ndncatchunks3
./libndn-cpp-dev.a(certificate.cpp.1.o): In function `CryptoPP::SourceTemplate<CryptoPP::StringStore>::PumpAll2(bool)':
/usr/local/include/cryptopp/filters.h:767: undefined reference to `CryptoPP::BufferedTransformation::TransferAllTo2(CryptoPP::BufferedTransformation&, std::string const&, bool)'
./libndn-cpp-dev.a(certificate.cpp.1.o): In function `CryptoPP::SourceTemplate<CryptoPP::StringStore>::PumpMessages2(unsigned int&, bool)':
/usr/local/include/cryptopp/filters.h:765: undefined reference to `CryptoPP::BufferedTransformation::TransferMessagesTo2(CryptoPP::BufferedTransformation&, unsigned int&, std::string const&, bool)'
(omitted)
./libndn-cpp-dev.a(certificate-subject-description.cpp.1.o): In function `ndn::CertificateSubjectDescription::encode(CryptoPP::BufferedTransformation&) const':
/scratch/NDN-Routing/NFD-code-fbsd/ndn-cpp-dev/build/../src/security/certificate-subject-description.cpp:36: undefined reference to `CryptoPP::DEREncodeTextString(CryptoPP::BufferedTransformation&, std::string const&, unsigned char)'
Waf: Leaving directory `/scratch/NDN-Routing/NFD-code-fbsd/ndn-cpp-dev/build'
Build failed
-> task in 'ndncatchunks3' failed (exit status 1):
{task 689331116: cxxprogram ndncatchunks3.cpp.1.o -> ndncatchunks3}
['/usr/bin/g++', '-L/usr/local/lib', 'tools/ndncatchunks3.cpp.1.o', '-o', '/scratch/NDN-Routing/NFD-code-fbsd/ndn-cpp-dev/build/tools/ndncatchunks3', '-Wl,-Bstatic', '-L.', '-lndn-cpp-dev', '-Wl,-Bdynamic', '-L/usr/local/lib', '-L/usr/local/lib', '-lboost_system', '-lboost_filesystem', '-lboost_date_time', '-lboost_iostreams', '-lboost_regex', '-lboost_program_options', '-lboost_chrono', '-lssl', '-lcrypto', '-lcryptopp', '-lsqlite3', '-lrt', '-lpthread']
Similar error occurs if I specify CXX=clang++
.
Files
Updated by Alex Afanasyev over 10 years ago
Just checked on FreeBSD 10.0, but 64-bit and compilation was successful.
Is it a clean FreeBSD and no other cryptopp/libndn-cpp-dev previlusly installed?
Updated by Junxiao Shi over 10 years ago
This is a clean node based on Emulab FBSD100-STD image.
build/config.log has these lines for Crypto++:
----------------------------------------
Checking Crypto++ lib
562
----------------------------------------
Checking if CryptoPP library works
==>
#include <cryptopp/config.h>
int main(int argc, char **argv) {
(void)argc; (void)argv;
return 0;
}
<==
[1/2] [32mcxx: build/.conf_check_9325eac799bd175a1180bd512f86b291/test.cpp -> build/.conf_check_9325eac799bd175a1180bd512f86b291/testbuild/test.cpp.1.o
[0m
['/usr/bin/g++', '-pedantic', '-Wall', '-Wno-long-long', '-O2', '-g', '-I/usr/local/include', '-DHAVE_OPENSSL=1', '-DHAVE_SQLITE3=1', '../test.cpp', '-c', '-o', 'test.cpp.1.o']
[2/2] [33mcxxprogram: build/.conf_check_9325eac799bd175a1180bd512f86b291/testbuild/test.cpp.1.o -> build/.conf_check_9325eac799bd175a1180bd512f86b291/testbuild/testprog
[0m
['/usr/bin/g++', '-L/usr/local/lib', 'test.cpp.1.o', '-o', '/scratch/NDN-Routing/NFD-code-fbsd/ndn-cpp-dev/build/.conf_check_9325eac799bd175a1180bd512f86b291/testbuild/testprog', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-lcryptopp']
yes
----------------------------------------
Updated by Alex Afanasyev over 10 years ago
Can you give me this image, so I can try in my virtualbox? Or you can just give me the access...
Updated by Junxiao Shi over 10 years ago
- Tracker changed from Task to Bug
The image with dependencies installed is FBSD100-NFD.
You need an Emulab account to access it.
Updated by Alex Afanasyev over 10 years ago
Specifically this problem is that cryptopp is compiled against libc++, but somehow clang by default does not select it as STL library. This can be forced with additional -stdlib=libc++
flags.
But even though I got past these messages, I got another errors
17:50:46 runner ['clang++', '-L/usr/local/lib', 'tests/main.cpp.1.o', 'tests/management/test-ndnd-forwarding-entry.cpp.1.o', 'tests/management/test-nfd-control-command.cpp.1.o', 'tests/management/test-nfd-control-parameters.cpp.1.o', 'tests/management/test-nfd-control-response.cpp.1.o', 'tests/management/test-nfd-controller.cpp.1.o', 'tests/management/test-nfd-face-event-notification.cpp.1.o', 'tests/management/test-nfd-face-status.cpp.1.o', 'tests/management/test-nfd-fib-entry.cpp.1.o', 'tests/management/test-nfd-forwarder-status.cpp.1.o', 'tests/management/test-nrd.cpp.1.o', 'tests/security/identity-fixture.cpp.1.o', 'tests/security/test-certificate-cache.cpp.1.o', 'tests/security/test-encode-decode-certificate.cpp.1.o', 'tests/security/test-keychain.cpp.1.o', 'tests/security/test-sec-tpm-file.cpp.1.o', 'tests/security/test-signature-sha256.cpp.1.o', 'tests/security/test-signed-interest.cpp.1.o', 'tests/security/test-validator.cpp.1.o', 'tests/test-block.cpp.1.o', 'tests/test-data.cpp.1.o', 'tests/test-exclude.cpp.1.o', 'tests/test-interest.cpp.1.o', 'tests/test-key-locator.cpp.1.o', 'tests/test-name.cpp.1.o', 'tests/transport/test-unix-transport.cpp.1.o', 'tests/util/test-config-file.cpp.1.o', 'tests/util/test-io.cpp.1.o', 'tests/util/test-regex.cpp.1.o', 'tests/util/test-scheduler.cpp.1.o', 'tests/util/test-time.cpp.1.o', 'tests/security/test-sec-public-info-sqlite3.cpp.1.o', '-o', '/usr/home/cawka/ndn-cpp-dev/build/unit-tests', '-Wl,-Bstatic', '-L.', '-lndn-cpp-dev', '-Wl,-Bdynamic', '-L/usr/local/lib', '-L/usr/local/lib', '-lboost_system', '-lboost_filesystem', '-lboost_date_time', '-lboost_iostreams', '-lboost_regex', '-lboost_program_options', '-lboost_chrono', '-lboost_unit_test_framework', '-lssl', '-lcrypto', '-lcryptopp', '-lsqlite3', '-lrt', '-lpthread']
./libndn-cpp-dev.a(sec-tpm.cpp.1.o): In function `CryptoPP::AllocatorWithCleanup<unsigned char, true>::allocate(unsigned int, void const*)':
/usr/local/include/cryptopp/secblock.h:97: undefined reference to `CryptoPP::AlignedAllocate(unsigned int)'
./libndn-cpp-dev.a(sec-tpm.cpp.1.o): In function `CryptoPP::AllocatorWithCleanup<unsigned char, true>::deallocate(void*, unsigned int)':
/usr/local/include/cryptopp/secblock.h:109: undefined reference to `CryptoPP::AlignedDeallocate(void*)'
This something to do with some flags in crypotopp. Will keep posted.
Updated by Alex Afanasyev over 10 years ago
Ok. Figured out the problem and was able to compile code finally.
Somehow, cryptopp library has a bug of not defining -DCRYPTOPP_DISABLE_ASM
flag in cryptopp/config.h with which it was compiled. On X86 platform this leads to incorrect behavior in secblock.h.
So, the solution is to define this during configure stage. Here are the flags that I used to successfully compile the library on FreeBSD 10.0 32bit (clean install)
CXXFLAGS="-std=c++03 -DCRYPTOPP_DISABLE_ASM -stdlib=libc++ -pedantic -Wall -Wno-long-long -O0 -g3 -fcolor-diagnostics -fdiagnostics-color -Werror" ./waf configure --debug
Note that on 10.0, clang is actually a default compiler (c++ links to clang++).
PS
Here is info for the current platform tried. Will report flags for compilation on FreeBSD 9.2 (emulab image)
[jenkins@freebsd-10 ~/NFD]$ uname -a
FreeBSD freebsd-10.0-32 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Fri Jan 17 01:46:25 UTC 2014 root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC i386
[jenkins@freebsd-10 ~/NFD]$ pkg version | grep -E 'boost|cryptopp|sqlite3'
boost-libs-1.55.0_1 =
cryptopp-5.6.2_1 =
sqlite3-3.8.4.2 =
Updated by Alex Afanasyev over 10 years ago
Report of successful compilation on FreeBSD 9.2 in Emulad (I used FBSD100-NFD, but somehow I got 9.2... not sure what I did wrong).
[root@node-1 /usr/home/cawka/ndn-cpp-dev]# uname -a
FreeBSD node-1.test-nfd-freebsd-32.ndn-routing.emulab.net 10.0-CURRENT FreeBSD 10.0-CURRENT #1 r254898: Mon Aug 26 17:35:52 MDT 2013 root@node.freebsd10-node.testbed.emulab.net:/usr/obj/repos/src/sys/TESTBED-GENERIC-POLLING-NODEBUG i386
[root@node-1 /usr/home/cawka/ndn-cpp-dev]# pkg version | grep -E 'boost-all|cryptopp|sqlite3|libpcap'
boost-all-1.55.0 =
cryptopp-5.6.2_1 =
libpcap-1.5.2 =
sqlite3-3.8.4.2 =
Code does not link if default gcc 4.2.1 is used (though I found some compilation issues with test cases, will submit patch). This is because binary packages (cryptopp and I suspect boost) are compiled against libc++ with clang. So, this is just a known "feature". Here is my configure:
[root@node-1 /usr/home/cawka/ndn-cpp-dev]# CXX=clang++ CXXFLAGS="-pedantic -Wall -Wno-long-long -O0 -g3 -Werror -DCRYPTOPP_DISABLE_ASM" ./waf configure --debug --with-tests
Updated by Junxiao Shi over 10 years ago
- File 201404210805.out 201404210805.out added
Build is still failing with ndn-cpp-dev commit commit:5c785d670f2ce63254539456429f9f376b48450e
Commands attempted:
./waf distclean
CXX=clang++ CXXFLAGS="-pedantic -Wall -Wno-long-long -O0 -g3 -Werror -DCRYPTOPP_DISABLE_ASM" ./waf configure --debug --with-tests
./waf -j1
Output is attached as 201404210805.out
Updated by Alex Afanasyev over 10 years ago
Are you sure you have all the files? I don't see the reason why you're getting
`fatal error: 'util/config-file.hpp' file not found`
Updated by Junxiao Shi over 10 years ago
Yes, I have all the files.
[sjx@ops /scratch/NDN-Routing/NFD-code-fbsd/ndn-cpp-dev]$ find ./ | grep config-file.hpp
./src/util/config-file.hpp
Updated by Alex Afanasyev over 10 years ago
I confirm that these type of errors happen when I tried to compile in /scratch
folder. I didn't (yet?) get this specific error, but I have already seen
fatal error: error in backend: IO failure on output stream.
and
In file included from ../tests/management/test-nfd-face-status.cpp:7:
/scratch/NDN-Routing/test/ndn-cpp-dev/src/management/nfd-face-status.hpp:14:10: fatal error: '../encoding/encoding-buffer.hpp' file not found
#include "../encoding/encoding-buffer.hpp"
^
1 error generated.
I didn't have these errors when compiling in /usr/home/some-folder
Updated by Junxiao Shi over 10 years ago
Problem persists in a non-NFS location.
Waf: Entering directory `/tmp/ndn-cxx/build'
fatal: No names found, cannot describe anything.
[ 69/104] cxxprogram: build/tests/main.cpp.1.o build/tests/management/test-nfd-channel-status.cpp.1.o build/tests/management/test-nfd-control-command.cpp.1.o build/tests/management/test-nfd-control-parameters.cpp.1.o build/tests/management/test-nfd-control-response.cpp.1.o build/tests/management/test-nfd-controller.cpp.1.o build/tests/management/test-nfd-face-event-notification.cpp.1.o build/tests/management/test-nfd-face-status.cpp.1.o build/tests/management/test-nfd-fib-entry.cpp.1.o build/tests/management/test-nfd-forwarder-status.cpp.1.o build/tests/management/test-nfd-strategy-choice.cpp.1.o build/tests/security/identity-fixture.cpp.1.o build/tests/security/test-certificate-cache.cpp.1.o build/tests/security/test-encode-decode-certificate.cpp.1.o build/tests/security/test-keychain.cpp.1.o build/tests/security/test-sec-tpm-file.cpp.1.o build/tests/security/test-signature-sha256.cpp.1.o build/tests/security/test-signed-interest.cpp.1.o build/tests/security/test-validator.cpp.1.o build/tests/test-block.cpp.1.o build/tests/test-data.cpp.1.o build/tests/test-exclude.cpp.1.o build/tests/test-interest.cpp.1.o build/tests/test-key-locator.cpp.1.o build/tests/test-name.cpp.1.o build/tests/test-version.cpp.1.o build/tests/transport/test-unix-transport.cpp.1.o build/tests/util/test-config-file.cpp.1.o build/tests/util/test-io.cpp.1.o build/tests/util/test-regex.cpp.1.o build/tests/util/test-scheduler.cpp.1.o build/tests/util/test-time.cpp.1.o build/tests/security/test-sec-public-info-sqlite3.cpp.1.o -> build/unit-tests
tests/security/test-encode-decode-certificate.cpp.1.o: In function `ndn::SecurityTestCertificate::Encode::test_method()':
/tmp/ndn-cxx/build/../tests/security/test-encode-decode-certificate.cpp:93: undefined reference to `CryptoPP::StringSinkTemplate<std::string>::StringSinkTemplate(std::string&)'
tests/security/test-encode-decode-certificate.cpp.1.o: In function `~StringSinkTemplate':
/usr/local/include/cryptopp/filters.h:586: undefined reference to `vtable for CryptoPP::StringSinkTemplate<std::string>'
(omitted)
./libndn-cxx.a(certificate-subject-description.cpp.2.o): In function `ndn::CertificateSubjectDescription::decode(CryptoPP::BufferedTransformation&)':
/tmp/ndn-cxx/build/../src/security/certificate-subject-description.cpp:69: undefined reference to `CryptoPP::BERDecodeTextString(CryptoPP::BufferedTransformation&, std::string&, unsigned char)'
./libndn-cxx.a(certificate-subject-description.cpp.2.o): In function `ndn::CertificateSubjectDescription::encode(CryptoPP::BufferedTransformation&) const':
/tmp/ndn-cxx/build/../src/security/certificate-subject-description.cpp:44: undefined reference to `CryptoPP::DEREncodeTextString(CryptoPP::BufferedTransformation&, std::string const&, unsigned char)'
Waf: Leaving directory `/tmp/ndn-cxx/build'
Build failed
-> task in '../unit-tests' failed (exit status 1):
{task 689673068: cxxprogram main.cpp.1.o,test-nfd-channel-status.cpp.1.o,test-nfd-control-command.cpp.1.o,test-nfd-control-parameters.cpp.1.o,test-nfd-control-response.cpp.1.o,test-nfd-controller.cpp.1.o,test-nfd-face-event-notification.cpp.1.o,test-nfd-face-status.cpp.1.o,test-nfd-fib-entry.cpp.1.o,test-nfd-forwarder-status.cpp.1.o,test-nfd-strategy-choice.cpp.1.o,identity-fixture.cpp.1.o,test-certificate-cache.cpp.1.o,test-encode-decode-certificate.cpp.1.o,test-keychain.cpp.1.o,test-sec-tpm-file.cpp.1.o,test-signature-sha256.cpp.1.o,test-signed-interest.cpp.1.o,test-validator.cpp.1.o,test-block.cpp.1.o,test-data.cpp.1.o,test-exclude.cpp.1.o,test-interest.cpp.1.o,test-key-locator.cpp.1.o,test-name.cpp.1.o,test-version.cpp.1.o,test-unix-transport.cpp.1.o,test-config-file.cpp.1.o,test-io.cpp.1.o,test-regex.cpp.1.o,test-scheduler.cpp.1.o,test-time.cpp.1.o,test-sec-public-info-sqlite3.cpp.1.o -> unit-tests}
['/usr/bin/g++', 'tests/main.cpp.1.o', 'tests/management/test-nfd-channel-status.cpp.1.o', 'tests/management/test-nfd-control-command.cpp.1.o', 'tests/management/test-nfd-control-parameters.cpp.1.o', 'tests/management/test-nfd-control-response.cpp.1.o', 'tests/management/test-nfd-controller.cpp.1.o', 'tests/management/test-nfd-face-event-notification.cpp.1.o', 'tests/management/test-nfd-face-status.cpp.1.o', 'tests/management/test-nfd-fib-entry.cpp.1.o', 'tests/management/test-nfd-forwarder-status.cpp.1.o', 'tests/management/test-nfd-strategy-choice.cpp.1.o', 'tests/security/identity-fixture.cpp.1.o', 'tests/security/test-certificate-cache.cpp.1.o', 'tests/security/test-encode-decode-certificate.cpp.1.o', 'tests/security/test-keychain.cpp.1.o', 'tests/security/test-sec-tpm-file.cpp.1.o', 'tests/security/test-signature-sha256.cpp.1.o', 'tests/security/test-signed-interest.cpp.1.o', 'tests/security/test-validator.cpp.1.o', 'tests/test-block.cpp.1.o', 'tests/test-data.cpp.1.o', 'tests/test-exclude.cpp.1.o', 'tests/test-interest.cpp.1.o', 'tests/test-key-locator.cpp.1.o', 'tests/test-name.cpp.1.o', 'tests/test-version.cpp.1.o', 'tests/transport/test-unix-transport.cpp.1.o', 'tests/util/test-config-file.cpp.1.o', 'tests/util/test-io.cpp.1.o', 'tests/util/test-regex.cpp.1.o', 'tests/util/test-scheduler.cpp.1.o', 'tests/util/test-time.cpp.1.o', 'tests/security/test-sec-public-info-sqlite3.cpp.1.o', '-o', '/tmp/ndn-cxx/build/unit-tests', '-Wl,-Bstatic', '-L.', '-lndn-cxx', '-Wl,-Bdynamic', '-L/usr/local/lib', '-L/usr/local/lib', '-L/usr/local/lib', '-lboost_system', '-lboost_filesystem', '-lboost_date_time', '-lboost_iostreams', '-lboost_regex', '-lboost_program_options', '-lboost_chrono', '-lboost_unit_test_framework', '-lssl', '-lcrypto', '-lcryptopp', '-lsqlite3', '-lrt', '-lpthread']
Snippet from build/config.log:
----------------------------------------
Checking Crypto++ lib
562
----------------------------------------
Checking if CryptoPP library works
==>
#include <cryptopp/config.h>
int main(int argc, char **argv) {
(void)argc; (void)argv;
return 0;
}
<==
[1/2] ESC[32mcxx: build/.conf_check_6a78f4c666aa1d864c15d677c916b759/test.cpp ->
build/.conf_check_6a78f4c666aa1d864c15d677c916b759/testbuild/test.cpp.1.o
ESC[0m
['/usr/bin/g++', '-pedantic', '-Wall', '-Wno-long-long', '-O0', '-g3', '-Werror'
, '-I/usr/local/include', '-D_DEBUG=1', '-DHAVE_PTHREAD=1', '-DHAVE_RT=1', '-DHA
VE_OPENSSL=1', '-DHAVE_SQLITE3=1', '../test.cpp', '-c', '-o', 'test.cpp.1.o']
[2/2] ESC[33mcxxprogram: build/.conf_check_6a78f4c666aa1d864c15d677c916b759/testbuild/test.cpp.1.o -> build/.conf_check_6a78f4c666aa1d864c15d677c916b759/testbui
int main(int argc, char **argv) {
(void)argc; (void)argv;
return 0;
}
<==
[1/2] ESC[32mcxx: build/.conf_check_6a78f4c666aa1d864c15d677c916b759/test.cpp ->
build/.conf_check_6a78f4c666aa1d864c15d677c916b759/testbuild/test.cpp.1.o
ESC[0m
['/usr/bin/g++', '-pedantic', '-Wall', '-Wno-long-long', '-O0', '-g3', '-Werror'
, '-I/usr/local/include', '-D_DEBUG=1', '-DHAVE_PTHREAD=1', '-DHAVE_RT=1', '-DHA
VE_OPENSSL=1', '-DHAVE_SQLITE3=1', '../test.cpp', '-c', '-o', 'test.cpp.1.o']
[2/2] ESC[33mcxxprogram: build/.conf_check_6a78f4c666aa1d864c15d677c916b759/test
build/test.cpp.1.o -> build/.conf_check_6a78f4c666aa1d864c15d677c916b759/testbui
ld/testprog
ESC[0m
['/usr/bin/g++', 'test.cpp.1.o', '-o', '/tmp/ndn-cxx/build/.conf_check_6a78f4c666aa1d864c15d677c916b759/testbuild/testprog', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-L/usr/local/lib', '-lcryptopp', '-lpthread']
yes
Updated by Alex Afanasyev over 10 years ago
There are 2 problems and only one of them caused by NFS
you need to configure with the proper flags
Updated by Junxiao Shi over 10 years ago
Same error persists even if I configure with the command line in note-8.
Updated by Alex Afanasyev over 10 years ago
show me the error.
note 8 does not have all correct flags. Use note 6 and select clang++ as a compiler. With just note 8 you will get another error.
Updated by Junxiao Shi over 10 years ago
- Category set to Base
- Target version set to Unsupported
Updated by Junxiao Shi over 7 years ago
- Status changed from New to Rejected
FreeBSD 10.0 has reached end-of-life on Jan 31, 2015.