Old 28th August 2006, 19:22   #1
carlosc
Junior Member
 
Join Date: Aug 2006
Posts: 6
makensis scons build failing on linux

Can someone please advise me how to get around the following build issue on linux:

nsis-2.19-src]$ scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no
scons: Reading SConscript files ...
Delete("nsis-28-Aug-2006.cvs")
Delete(".instdist")
Delete(".test")
Using GNU tools configuration
Checking for linker flag $MAP_FLAG... (cached) no
Checking for linker flag -s... (cached) no
Checking for linker flag $MAP_FLAG... (cached) no
Checking for linker flag -s... (cached) no
Checking for memcpy requirement... (cached) yes
Checking for memset requirement... (cached) yes
Checking for linker flag -pthread... (cached) no
Checking for __BIG_ENDIAN__... (cached) yes
Checking for main() in C library gdi32... (cached) no
Checking for main() in C library user32... (cached) no
Checking for main() in C library pthread... (cached) no
Checking for main() in C library stdc++... (cached) no
Checking for main() in C library iconv... (cached) no
Checking for main() in C library dl... (cached) no
Checking for main() in C library gdi32... (cached) no
Checking for main() in C library iconv... (cached) no
Checking for main() in C library user32... (cached) no
Checking for main() in C++ library cppunit... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/release/makensis/build.o -c -O2 -Wall -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 Source/build.cpp
g++ -o build/release/makensis/lang.o -c -O2 -Wall -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 Source/lang.cpp
g++ -o build/release/makensis/makenssi.o -c -O2 -Wall -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 Source/makenssi.cpp
g++ -o build/release/makensis/script.o -c -O2 -Wall -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 Source/script.cpp
g++ -o build/release/makensis/makensis build/release/makensis/build.o build/release/makensis/clzma.o build/release/makensis/crc32.o build/release/makensis/DialogTemplate.o build/release/makensis/dirreader.o build/release/makensis/fileform.o build/release/makensis/growbuf.o build/release/makensis/lang.o build/release/makensis/lineparse.o build/release/makensis/makenssi.o build/release/makensis/mmap.o build/release/makensis/Plugins.o build/release/makensis/ResourceEditor.o build/release/makensis/ResourceVersionInfo.o build/release/makensis/script.o build/release/makensis/ShConstants.o build/release/makensis/strlist.o build/release/makensis/tokens.o build/release/makensis/util.o build/release/makensis/writer.o build/release/makensis/bzip2/blocksort.o build/release/makensis/bzip2/bzlib.o build/release/makensis/bzip2/compress.o build/release/makensis/bzip2/huffman.o build/release/makensis/7zip/7zGuids.o build/release/makensis/7zip/Common/CRC.o build/release/makensis/7zip/7zip/Compress/LZ/LZInWindow.o build/release/makensis/7zip/7zip/Compress/LZMA/LZMAEncoder.o build/release/makensis/7zip/7zip/Common/OutBuffer.o build/release/makensis/7zip/7zip/Compress/RangeCoder/RangeCoderBit.o build/release/makensis/7zip/Common/Alloc.o build/release/makensis/zlib/deflate.o build/release/makensis/zlib/trees.o
build/release/makensis/clzma.o(.text+0x67d): In function `CLZMA::End()':
: undefined reference to `pthread_detach'
build/release/makensis/clzma.o(.text+0x6b8): In function `CLZMA::End()':
: undefined reference to `pthread_join'
collect2: ld returned 1 exit status
scons: *** [build/release/makensis/makensis] Error 1
scons: building terminated because of errors.
carlosc is offline   Reply With Quote
Old 28th August 2006, 23:19   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
The tests are cached, so I'll take a wild guess and say you've moved the entire directory from another machine which has pthreads in glibc to a machine that has a separate pthread library. Try building from a clean source tree.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 29th August 2006, 01:24   #3
carlosc
Junior Member
 
Join Date: Aug 2006
Posts: 6
I'm guessing (not knowing much about scons) that the reason they are cached is because I reran the scons build script. But I got the same result when I built initially after downloading the sources. BTW, if I add "-pthread" to the linker line makensis is linked successfully. What does that say about what scons is (or is not) doing with regards to setting pthread linking correctly?

Thanks
Carlos
carlosc is offline   Reply With Quote
Old 29th August 2006, 07:37   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
It means the -pthread test failed incorrectly. Could you attach the config.log file generated for a clean build?

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 29th August 2006, 12:44   #5
carlosc
Junior Member
 
Join Date: Aug 2006
Posts: 6
Attached is the confg.log file that was generated when I reran the scons build. If this is not what you wanted please send me the exact build line you want me to run to generate the config.log you need.

Note: to make it work I copied/pasted the g++ as follows:

[nsis-2.19-src] $>g++ -pthread -o build/release/makensis/makensis build/release/makensis/build.o build/release/makensis/clzma.o build/release/makensis/crc32.o build/release/makensis/DialogTemplate.o build/release/makensis/dirreader.o build/release/makensis/fileform.o build/release/makensis/growbuf.o build/release/makensis/lang.o build/release/makensis/lineparse.o build/release/makensis/makenssi.o build/release/makensis/mmap.o build/release/makensis/Plugins.o build/release/makensis/ResourceEditor.o build/release/makensis/ResourceVersionInfo.o build/release/makensis/script.o build/release/makensis/ShConstants.o build/release/makensis/strlist.o build/release/makensis/tokens.o build/release/makensis/util.o build/release/makensis/writer.o build/release/makensis/bzip2/blocksort.o build/release/makensis/bzip2/bzlib.o build/release/makensis/bzip2/compress.o build/release/makensis/bzip2/huffman.o build/release/makensis/7zip/7zGuids.o build/release/makensis/7zip/Common/CRC.o build/release/makensis/7zip/7zip/Compress/LZ/LZInWindow.o build/release/makensis/7zip/7zip/Compress/LZMA/LZMAEncoder.o build/release/makensis/7zip/7zip/Common/OutBuffer.o build/release/makensis/7zip/7zip/Compress/RangeCoder/RangeCoderBit.o build/release/makensis/7zip/Common/Alloc.o build/release/makensis/zlib/deflate.o build/release/makensis/zlib/trees.o
Attached Files
File Type: txt config.txt (10.9 KB, 270 views)
carlosc is offline   Reply With Quote
Old 29th August 2006, 12:54   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
That's the file and the command line doesn't matter in this case, but I need it after a clean build. SCons must run only once after the source tree is completely cleaned so config.log won't be overwritten. In the log you've attached, it doesn't show the results of the real configuration test because it's cached.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 29th August 2006, 13:28   #7
carlosc
Junior Member
 
Join Date: Aug 2006
Posts: 6
Can you please tell me which command I should run to generate the config.log file you need? I've ran "scons --clean" but it still shows cached. Which configuration should I delete that keeps this cache information?

Thanks
Carlos
carlosc is offline   Reply With Quote
Old 29th August 2006, 13:29   #8
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
scons doesn't have a clean command for that, you need to clean it yourself. The easiest method is simply to delete the folder and extract the files again.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 29th August 2006, 15:16   #9
carlosc
Junior Member
 
Join Date: Aug 2006
Posts: 6
Hmm, it built OK this time. So if I'm to guess at what happened, originally when I first built the thing I didn't use any arguments in the scons command line. I then read that I should only build makensis (not the plugins) and I then used the arguments per the doc. Perhaps the first attempt cached some invalid options.

Thanks
Carlos
carlosc is offline   Reply With Quote
Old 8th November 2006, 13:46   #10
moenk
Junior Member
 
Join Date: Nov 2006
Posts: 2
Quote:
Originally posted by kichik It means the -pthread test failed incorrectly. (...)
Hi there! I have a very similar problem trying to build nsis 2.21 on Solaris.
code:
scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no

ends up somewhere with:
  • g++ -o build/release/makensis/makensis -pthread build/release/makensis/build.o (...)
    g++: unrecognized option `-pthread'
    scons: done building targets.
I modified SConstruct as follows:
code:
#defenv = Environment()
defenv = Environment(CXX = 'g++')
defenv.Replace(CXXVERSION = '3.3.2')


One more error is:
  • Checking for linker flag -s... ld.so.1: conftest_2: fatal: libstdc++.so.5: open failed: No such file or directory
    Killed
    no
    Checking for linker flag -s... ld.so.1: conftest_5: fatal: libstdc++.so.5: open failed: No such file or directory
    Killed
    no

And in the conf.log it reads:
  • file /user/moe/src/nsis-2.21-src/SCons/utils.py,line 72:
    Configure(confdir = .sconf_temp)
    scons: Configure: Checking for linker flag -pthread...
    .sconf_temp/conftest_8.c <-
    |
    | int main() {
    | return 0;
    | }
    |
    gcc -o .sconf_temp/conftest_8.o -c -O2 -Wall .sconf_temp/conftest_8.c
    .sconf_temp/conftest_8.c:5:1: warning: no newline at end of file
    gcc -o .sconf_temp/conftest_8 -pthread .sconf_temp/conftest_8.o
    gcc: unrecognized option `-pthread'
    scons: Configure: yes
Do you have any idea what's wrong here?

TIA,
MOENK
moenk is offline   Reply With Quote
Old 8th November 2006, 14:40   #11
moenk
Junior Member
 
Join Date: Nov 2006
Posts: 2
One more thing:
Do I definately need a XCompiler?
I cannot imagine, that putting "my" new makensis into a precompiled zip for win32 will work on SAPRC? At the moment, when running ./makensis nothing happens at all
Sorry, but the documentation is not very detailled for building on POSIX ...

Again, Thanks,
MOENK

PS: I got rid of the "-pthread" - message after changing conf/gnu
code:
#conf.CheckLinkFlag('-pthread')

Is that ok ?
moenk is offline   Reply With Quote
Old 8th November 2006, 18:11   #12
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
In your case, the -pthread actually succeeded on accident. But that's OK as it's ignored by gcc if it's not supported.

The config.log part you took and the output piece do not match. You've pasted the output of the -s test and the log for the -pthread test.

As the documentation says, you don't need a cross-compiler. You can just drop makensis into the precompiled zip for win32. The fact that ./makensis fails is probably because of unaligned memory access because you're trying to run on SPARC. If the wrong files are present, it'll tell you, so that's not the problem.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump