What's new

Compiling from the sourse

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

rxu

Occasional Visitor
Hi Merlin,

recently I tried to follow your HOWTO Compile From Source guide to get the latest build from your Github repo.

Regrettably, after several attempts I was unable to compile the firmware due to the following error with lighthttpd:
configure:3801: checking whether the C compiler works
configure:3823: mipsel-uclibc-gcc -I/home/rxu/asuswrt-merlin/release/src/router/lighttpd-1.4.29/../pcre-8.12 -I/opt/brcm/hndtools-mipsel-linux/include -I/home/rxu/asuswrt-merlin/release/src/router/lighttpd-1.4.29/../sqlite -I/home/rxu/asuswrt-merlin/release/src/router/lighttpd-1.4.29/../../include -I/home/rxu/asuswrt-merlin/release/src/router/lighttpd-1.4.29/../nvram -I/home/rxu/asuswrt-merlin/release/src/router/lighttpd-1.4.29/../shared -I/home/rxu/asuswrt-merlin/release/src/router/lighttpd-1.4.29/../libdisk -DHAVE_OPENSSL_SSL_H=1 -DHAVE_LIBSSL=1 -DEMBEDDED_EANBLE=1 -L/opt/brcm/hndtools-mipsel-linux/lib -ldl -L/home/rxu/asuswrt-merlin/release/src/router/lighttpd-1.4.29/../pcre-8.12/.libs -lpcre -L/home/rxu/asuswrt-merlin/release/src/router/lighttpd-1.4.29/../libxml2/.libs -lxml2 -L/home/rxu/asuswrt-merlin/release/src/router/lighttpd-1.4.29/../openssl conftest.c -L/opt/brcm/hndtools-mipsel-linux/lib -L/home/rxu/asuswrt-merlin/release/src/router/lighttpd-1.4.29/../shared -lshared -L/home/rxu/asuswrt-merlin/release/src/router/lighttpd-1.4.29/../nvram -lnvram -L/home/rxu/asuswrt-merlin/release/src/router/lighttpd-1.4.29/../libdisk -ldisk >&5
/home/rxu/asuswrt-merlin/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/../../../../mipsel-linux-uclibc/bin/ld: cannot find -lpcre
collect2: ld returned 1 exit status
configure:3827: $? = 1
configure:3865: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "lighttpd"
| #define PACKAGE_TARNAME "lighttpd"
| #define PACKAGE_VERSION "1.4.29"
| #define PACKAGE_STRING "lighttpd 1.4.29"
| #define PACKAGE_BUGREPORT "contact@lighttpd.net"
| #define PACKAGE_URL ""
| #define PACKAGE "lighttpd"
| #define VERSION "1.4.29"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3870: error: in `/home/rxu/asuswrt-merlin/release/src/router/lighttpd-1.4.29':
configure:3872: error: C compiler cannot create executables
See `config.log' for more details

As far as I can see, there's either a problem with -lpcre or with the tree global compiling issue.
The config.log is attached to the post.

Any help would be appreciated.

Thanks beforehand.
 

Attachments

  • config.log.txt
    15.3 KB · Views: 412
What OS are you using to build the FW? I tested it this weekend with a fresh clone and it compiled properly for me under Ubuntu 12.04 LTS.
 
I'm using 12.04.1 LTS.

Try linux mint 13 it works much better for me when compiling the firmware

sudo apt-get install bison flex g++ g++-4.4 g++-multilib gawk gcc-multilib gconf-editor gitk lib32z1-dev libncurses5 libncurses5-dev libstdc++6-4.4-dev libtool m4 pkg-config zlib1g-dev gperf lib32z1-dev

sudo ln -s $HOME/asuswrt-merlin/tools/brcm /opt/brcm
export PATH=$PATH:/opt/brcm/hndtools-mipsel-linux/bin:/opt/brcm/hndtools-mipsel-uclibc/bin
sudo mkdir -p /media/ASUSWRT/
sudo ln -s $HOME/asuswrt-merlin/media/ASUSWRT/asuswrt

cd $HOME/asuswrt-merlin/release/src-rt

make clean

make rt-n66u

use exactly these commands
and it will build perfectly also try using virtualbox instead of vmware helped me a lot
 
I'm using 12.04.1 LTS.

Same version as me then. Try doing a "make clean ; make rt-n66u". If it still fails, try with a fresh clone from the repo, in case something is screwed up with your current copy of the repo.

Also I heard of people having issues if they had other crosscompile toolchains installed on their system in addition to Asuswrt's toolchain.
 
To make it clear, I just installed vanilla Ubuntu VM and tried to compile the FW on the fresh system installation. Got the same error as above.
 
To make it clear, I just installed vanilla Ubuntu VM and tried to compile the FW on the fresh system installation. Got the same error as above.

Make sure you installed all the listed pre-requisite packages, as they are not included in a default Ubuntu install.

sudo apt-get install autoconf automake bash bison bzip2 diffutils file flex g++ gawk groff-base libncurses-dev libtool libslang2 make patch perl sed shtool subversion tar texinfo zlib1g zlib1g-dev git-core gettext libexpat1-dev libssl-dev cvs gperf unzip python libxml-parser-perl gcc-multilib gconf-editor gperf synaptic

You might also need a few additional packages for 32-bit compatibility (assuming you installed the 64-bit version of Ubuntu). I can't remember the exact list unfortunately.

Also, some people have issues trying to compile as a regular user - try compiling it as root instead (since this VM is dedicated to firmware compiling this shouldn't be a problem).
 
I think all packages should be installed as I copied the line you put above right from the HOWTO (it looks exactly the same).
Also, the system I installed is 32-bit, so no need to use compatibility packages I guess.
And yes, I run compiling as a root user :)

Now I have no clue what's the real problem preventing me from compiling the FW.
Probably I should actually try MINT13 :\
Or different VM even.
 
Only other idea would be to check which automake/autoconf version you have installed. There are a few alternative versions available in Ubuntu - I can't remember which one I have installed.

I hate *IX build systems :(
 
I think all packages should be installed as I copied the line you put above right from the HOWTO (it looks exactly the same).
Also, the system I installed is 32-bit, so no need to use compatibility packages I guess.
And yes, I run compiling as a root user :)

Now I have no clue what's the real problem preventing me from compiling the FW.
Probably I should actually try MINT13 :\
Or different VM even.

I posted a new HOWTO in the wiki section, it is based on mint 13 64bit.
Just copy and paste the lines and you are good to go no need to fiddle around with other packages.
Ubuntu always gives me headaches when compiling even mint is based on ubuntu they say, mint works better for me.

https://github.com/RMerl/asuswrt-merlin/wiki/Compile-Firmware-from-source-using-MINT-13
 
LOL. With mint13 I got error mipsel-uclibc-gcc: command not found.
$PATH seems to be ok though.
 
Updated VMWare PLayer to 5.0.1 and VMWare Tools to 9.2.2 (don't know if it affects somehow).
The last report is the following:
1) Host OS: Windows 8 - 64bit, guest OS: Ubuntu 12.04.1-LTS 32-bit, compiling result: failure with the same lighthttpd error.
2) Host OS: Windows 8 - 64bit, guest OS: Linux MINT 13 32-bit, compiling result: failure with the same lighthttpd error.
3) Host OS: Windows 8 - 32bit, guest OS: Ubuntu 12.04.1-LTS 32-bit, compiling result: success.

I think I'll also try 64-bit Ubuntu guest OS on 64-bit Win8 host OS, but it's clear there's some issue with Linux 32-bit vs VMWare 64-bit.
 
It fails with 64-bit host OS vs 64-bit guest OS as well.
Would be nice to sort out the problem somehow.
 
It fails with 64-bit host OS vs 64-bit guest OS as well.
Would be nice to sort out the problem somehow.

It works under 64bit , i really think that VMware is the problem when compiling instead use virtualbox.
Its free and afterward you can delete it.
 
It works under 64bit , i really think that VMware is the problem when compiling instead use virtualbox.
Its free and afterward you can delete it.

Oh, thanks for reminding me about Virtualbox. Tried it on Win8-64 vs Ubuntu 12.04.1-LTS 32-bit and everything went just fine.

Thank you again :)
 
I have tried a few different flavors of Ubuntu:
VMWare on Win 7 64bit, 12.04.1 32 bit
Virtualbox on WinXP 32bit, 12.04.1 64bit
Virtualbox on WinXP 32bit, 10.04 32bit
12.04.1 64bit native install on a laptop
All four configurations fail. Mostly for "command not found" or "No such file or directory".
I have tried compiling as a user, using sudo, or enabling the root account and compling after su.
There must be something I'm missing.
Please help.
 
"command not found" either means you didn't install all the required packages, or you didn't setup the PATH as specified in the documentation.

You will have to provide more information as to what you are doing, and at which point you get the error message.
 
You are correct, there were packages that were not installed. That is odd as I thought I had followed the instructions verbatim.
The native 12.04.1 64-bit compiles.
The virtualbox 10.04 32-bit may be compiling, but a "make clean" which I found in some instructions somewhere does not. I don't know if "make clean" is important or not.
 
Last edited:
You are correct, there were packages that were not installed. That is odd as I thought I had followed the instructions verbatim.
The native 12.04.1 64-bit compiles.
The virtualbox 10.04 32-bit may be compiling, but a "make clean" which I found in some instructions somewhere does not. I don't know if "make clean" is important or not.

Originally Ubuntu 10.04 was the recommended platform by Asus. I have since moved to Ubuntu 12.04 (the latest LTS release), so that's the platform I "officially" support and recommend for building the firmware.

make clean is not so important, unless you are rebuilding with a lot of changes, or rebuilding for a different router. In such cases I usually run a "make cleankernel clean" right before building the FW.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top