Why does linking take so long? Godot + Scons [closed] - c++

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 days ago.
Improve this question
I'm doing a build of a medium-sized C++ project (Godot) using Scons. On my machine, with 16MB RAM, after a build (all object files exist), I change one file, the object file is quickly recompiled, but to re-link everything takes around 5 mintues, and consumes a large amount of memory and CPU.
**CPU** **Memory**
40.0 45.1 ld
[100%] Linking Program bin/godot.linuxbsd.editor.dev.x86_64 ...
[100%] scons: done building targets.
[Time elapsed: 00:04:49.006]
What's happening here, and is there a way to expedite the linking process?

Related

Where do you usually install debug versions of libaries you build from sources? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Where do you usually install debug versions of libaries you build from sources, e.g. under /usr/local/debug, something else?
Consider a software library you use for your developing program. If you need to go into the library's source code under debugger, you need the library build without optimizations and with debug symbol generated. On the other hand, to normally run your application or estimate a performance you usually use 'release' build of the library, such builds are typically installed under /usr/local (default prefix).
thx
There is no standard answer to this.
If we assume that ${project} is the name of the relevant project - e.g llvm or jpeglib or whatever, then:
You can store the files locally in your home directory (~/${project}/...). I use the pattern /usr/local/${project}-debug/... on my home machine. At work, I have my files in /work/${project}/target-dir - where target-dir is the name of the embedded platform I built it for - since my work involves building for a variety of different platforms, and I don't want to rebuild every time.
Of course, this also means that you have to modify the linker path to take this path ahead of the "normal" install directory. Not a big problem, just add a -L~/${project}/lib or whatever you decided on. And when you run things, you may need to use LD_LIBRARY_PATH=...:${LD_LIBRARY_PATH} to ensure the correct shared library files are picked up.

Cross-compile a library for arm-none-eabi-gcc [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
My issues here led to the solution/new problem that I naively built the external library I am using for my host machine.
Thus of course arm-none-eabi-gcc compiler throws a fit when it meets elf32-i386 object files.
I originally built the library using:
./configure
make && make check
make install
So, now I thought I might be able to simply do:
make clean
./configure --host=arm-none-eabi
make && make check
make install
to fix it. Sadly mistaken.
I also tried --build=x86 but it seems this is auto-detected anyway.
CC=arm-none-eabi also seemed to have no effect.
What do I need to do in order to be able to build this library for linking when compiling with arm-none-eabi-gcc?
I was able to get this working with a couple of extra options specific to that configure script.
Though I didn't realise at the time of asking the question, these vary, so some familiarity or trial and error with the specific options available (./configure --help should always list those available) is required.
I should also note that make check will always fail on the build system, so isn't worthwhile.
You using wrong cross compiler .
arm-none-eabi is used for bare metal programs.
Instead use arm-none-linux-gnueabi-gcc which will contain library to solve undefined behaviours.
Have a look # Cross compile error "arm-none-eabi-g++ cannot find entry symbol"

I am not able to open this .a file and don't know how to use it [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
Here is the link: https://github.com/eyetribe
I tried to run this tet-cpp-client and in the output I am getting Gazeapilib.a file, and when I am trying to open it, it's giving me error that I can't open that file.
I want to know how to open this file, and what is the data of this file and how it can be used further in any program? I have not much knowledge about it so please help me to solve this error.
I am running this program in Ubuntu using cmake software.
The .a file is a library file which contains the definitions of the functions in the library that you compiled. It is not a standalone program and must be linked with other code to make a program. You must pass this library file to the linker after building your program.

What is meant by building a library? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I downloaded an open source library. It asked me to execute this file called "do" with the command ./do. Then it kept building the library for about 10 min. What is building a library exactly?
Building means compiling the source code to an executable format. A library is a term used to define reusable components.
For example, if you want to do some date conversion operations like dd/mm/yyyy format to mm/dd/yyyy, you can either write your own code or you can use re usable code which is already written by someone. Those reusable codes can be released to the public in many license forms; one of them is open source.
If the code is open source, the source code will be available for anyone to download. Sometimes the compiled version of the source code will also be there. Instructions will also be provided how to compile ( in other words , "build" ) the source code to an executable format which can be used in your code and that's what it means by "building" a library.
For an example, see the Joda-Time Java library.
Building is the process which encompasses source generation (for YACC, Qt MOC etc.), compilation of source code and linking of resulting object files. In brief: it's the sequence of operations that turn human readable source code into a machine-readable binary library.
Pro tip: read the description of the tag build under your question.

unable to compile mysql source [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Am trying to compile mysql client library source
source paclage\client\mysql.cc
i used gcc and g++ both
g++ -o mysql.cc mysql.cc
so whenever i compile it always gives error
In file included from mysql.cc:33:0:
client_priv.h:20:23: fatal error: my_global.h: No such file or directory
compilation terminated.
although my_global.h already exists , i moved it to the root folder of mysql.cc but same error , i did everything with it , but same error that library not found , i copied code of my_global.h and paste it in client_priv.h after that when i compile it says other libraries missing which were listed in client_priv.h ........ so help its quite confusing
You should follow official guide
Running gcc is not enough because there are lot of environment settings to be set, eg LIB paths, include paths etc.
They are using CMake to prepare build for you.
UPDATE:
If you want to compile program which will use mysql client library follow this guide.