Node: building from source vs binary distribution - node.js

I have downloaded node 0.10.31 source and built on my Linux machine using same steps mentioned in wiki. The source is just as it is and no changes made at all. The build is successful but when I compare bin/node file size with the one from binary downloaded there is around 900kb difference (built from source is bigger).
What is the reason?
Did I miss any optimizer or special config? Actually I wanted to use locally build node (after some change) in production. I just don't want to miss some settings here.
My environment:
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.5 (Santiago)
Release: 6.5
Codename: Santiago
Note: Already posted in node.js groups, sorry for the cross post.
Thanks

You can try and strip out debugging symbols. E.g.,
$ strip node
Debugging symbols are pieces of information embedded in an object file, and useful for debugging purposes. Unfortunately, they take up space in the file, so if you do not plan debugging the node interpreter itself you could get rid of them.
Moreover, please check out strip's manual page for a full list of choices when discarding symbols from object files.

Related

Updating the Compiler for the GPS Community Edition 2019 IDE

I've recently started working on a project that requires my complier to be above GNAT 4.8.5 - When I go to: Help > About
You can see that the version I'm using is 4.8.5
Also, when I run the gnatls -v command, I can see this...
[parallels#localhost ~]$ gnatls -v
GNATLS 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 1997-2013, Free Software Foundation, Inc.
Source Search Path:
<Current_Directory>
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/adainclude/
Object Search Path:
<Current_Directory>
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/adalib/
Project Search Path:
<Current_Directory>
/usr/x86_64-redhat-linux/lib/gnat
/usr/share/gpr
/usr/lib/gnat
[parallels#localhost ~]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --disable-multilib --enable-languages=c,c++,ada
Thread model: posix
gcc version 7.3.0 (GCC)
[parallels#localhost ~]$
Please could someone be able to tell me how to update my GNAT compiler? Also, I'm using the Centos 7 Operating System.
Thank you,
Lloyd
You don't need to install a compiler, you already have 3 (at least):
gcc 4.8.5 (the system compiler) in /usr/bin
gcc 7.3.0 (that you just built) in /usr/local/bin
gcc 8.3.1 (from GNAT CE 2019) in /home/parallels/opt/GNAT/2019/bin
Your PATH determines which GCC you pick up when you say just gcc, and which GNATLS you pick up when you say just gnatls, .. etc.
According to a previous post, your PATH is:
$ echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/var/lib/snapd/snap/bin:/home/parallels/.local/bin:/home/parallels/bin/home/parallels/opt/GNAT/2019/bin/home/parallels/opt/GNAT/2019/bin
so when you say just gcc the system looks at the first entry in the PATH (which is colon-separated) and .. there it is! so it executes that.
If you'd built your 7.3.0 GCC with Ada support, it would have found gnatls in the same place. I have a very strong suspicion that you didn't, so when you say just gnatls the system looks in /usr/local/bin - no luck - then in /usr/local/sbin - no luck - then in /usr/bin - whoopee! but that's the 4.8.5 GCC that you don't want.
Looking again at your PATH, the last part is mangled - you've added /home/parallels/bin and /home/parallels/opt/GNAT/2019/bin (twice) without including the colon separators, resulting in a nonexistent path. (/home/parallels/bin may well have been added by the system - I assume that /home/parallels is your home directory).
What you need to do is to make sure that you pick up the compiler that came with GNAT CE 2019 by putting its location first in your PATH. One way of doing this is by editing your shell startup files.
I don't know how CENTOS sets accounts up, and I don't know what your shell is. Assuming it's bash (type ps -p $$, should come back with bash or perhaps -bash; anything else, I can't help), you need to edit one of the shell startup files - I'm a little unclear about this, but I think it'll be ~/.bashrc (~ is shorthand for your home directory); see here for the gory details. Find the last mention of PATH and immediately after that line insert
export PATH=/home/parallels/opt/GNAT/2019/bin:$PATH
Open a new terminal window and say e.g. gnatls -v - you should pick up the GNAT CE 2019 one.
Only way I know of updating GNAT GPS CE from AdaCore is downloading the new one, installing it and then deleting the old one.
Another thing is to upgrade the gnat-gps that some systems had in ther repositories

nvcc fatal : Unsupported gpu architecture 'compute_20' while compiling matlab

(CentOS Linux release 7.3;cuda 9.1;GPU:Tesla P100-PCIE)
I've installed Matlab2018a on a server, but when I tried to do this:
vl_compilenn('enableGpu', true);
I encountered this:
vl_compilenn: CUDA: MEX config file:
'/data1/zhangdinghuai/gitrepo/explanatoryGraph/matconvnet-1.0-
beta24/matlab/src/config/mex_CUDA_glnxa64.xml'
Building with 'nvcc'.
nvcc fatal : Unsupported gpu architecture 'compute_20'
and
Building with 'nvcc'.
Error using mex
nvcc fatal : Unsupported gpu architecture 'compute_20'
Error in vl_compilenn>mex_compile (line 529)
mex(mopts{:}) ;
Error in vl_compilenn (line 487)
mex_compile(opts, srcs{i}, objfile, flags.mexcu) ;
I have searched similar questions but none of them works, can anyone give me a hand?
PS:more information about the server is listed below:
[zhangdinghuai#gpu01 2018a]$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-
noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages- 4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.3.1611 (Core)
Release: 7.3.1611
Codename: Core
[zhangdinghuai#gpu01 2018a]$ cat /etc/issue
\S
Kernel \r on an \m
[zhangdinghuai#gpu01 2018a]$ cat /proc/version
Linux version 3.10.0-514.26.1.el7.x86_64 (builder#kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Thu Jun 29 16:05:25 UTC 2017
In a similar thread here "nvcc fatal : Unsupported gpu architecture 'compute_20' while cuda 9.1+caffe+openCV 3.4.0 is installed" or at Askububtu , it was recommended to edit the makefile.config and to comment out the -gencode arch=compute_20.
Can you also share the exact kernel version you are using, the exact PCI device with PCI ID and driver versions if there are any. This might give better insight into your environment as well could help to answer further questions.
My solution was modifying the file matconvnet/matlab/src/config/mex_CUDA_glnxa64.xml.
Change the line
`NVCCFLAGS="-D_FORCE_INLINES -gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS"`
into
`NVCCFLAGS="-D_FORCE_INLINES -gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS"`

Installing/compiling OpenFOAM on a server without admin privileges

I'm trying to install/compile OpenFOAM on a remote server. As I don't have the admin privileges I have to compile it from scratch. Following the instructions here, when I try to run
source ~/OpenFOAM/OpenFOAM-v1712/etc/bashrc
I get the error:
No completion added for /home/foobar/OpenFOAM/OpenFOAM-v1712/platforms/linux64GccDPInt32Opt/bin
I checked the ~/OpenFOAM/OpenFOAM-v1712/etc/bashrc definitely exists and it is intact. I also checked the /home/foobar/OpenFOAM/OpenFOAM-v1712/ folder and there are no such thing as platforms folder! I searched and the only place I could see a similar error message is here where the issue is old Bash. I tried bash --version returning version 4.3.48(1)-release (x86_64-pc-linux-gnu) which is more than 4.2 as seems to be required.
My system information:
When I run the uname -a command on the server this is what I get
Linux foobar 4.4.0-101-generic #124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Looking into the possible required dependencies mentioned in this page, I checked the installed packages using the command apt list --installed | grep -i packageName, The packages installed are:
build-essential, flex, bison, cmake, zlib1g-dev, libboost-system-dev, libboost-thread-dev, libopenmpi-dev, openmpi-bin, gnuplot, libreadline-dev, libqt4-dev, libqt4-opengl-dev, freeglut3-dev,
And the ones not installed are:
libncurses-dev, libxt-dev, libqtwebkit-dev, libcgal-dev
which according to the installation page are not essential I suppose.
and checking the versions of the libraries installed:
mpirun --version --> (Open MPI) 1.10.2
gcc --version --> gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609
cmake --version --> 3.5.1
I would appreciate if could let me know
What is the problem and how I can solve it?
if not solvable, what are the alternative methods for me to have the OpenFOAM installed/compiled on the said server.
This is really embracing as it was just a wrong error! I was informed here that I could have ignored the error and go forward with compiling. Of course I couldn't compile the ParaVIEW/paraFoam as dependencies lack, but it is just a headless server without any GUI. So if you got this error just ignore it and go forwards with the compiling with:
./Allwmake
I have reported the issue here so they can fix it.
P.S. I reported this issue almost 9 month ago and now there is a new confusing message instead of the old one!
No completion added for /home/foobar/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/bin
... incorrect platform, or not yet compiled?

Toolchain to crosscompile Applications for BBB

My native machine is ubuntu based 14.04 LTS x86_64 system, I want to cross-compile applications and QT programs for Beaglebone black, which is an armv7 based system running on Debian 2015 distribution.
Which toolchain I should install on my native system, to get this done?
Here is a very usefull link how to set up the crosscompiler, uboot, kernel and the filesystem for a beaglebone black.
If you only want to crosscompiler, then just follow the few code lines in the Crosscompiler chapter
https://eewiki.net/display/linuxonarm/BeagleBone+Black
To cross-compile applications you need to use the ' arm-linux-gnueabihf ' compiler in the Ubuntu. Ubuntu 14.04 LTS was released with gcc-4.8.2. It is really important that the version of this GCC compiler matches the version deployed on the beaglebone black image. The reason for this is that different compilers have different libc versions, and version mismatching causes linker errors that are very tricky to solve.
You can try running,
gcc --version
on both your native Ubuntu system and the Beaglebone Black and see if the gcc version matches. If yes, you are good to go. Otherwise, install the appropriate toolchains.

Different os/abi in program and library

I have an application that is used unittest, written with gtest. My application work fine on Windows platform, several days ago i try run application on linux platform. Linux that is used have following configuration:
cat /etc/*-release
Cluster Manager v7.2
slave
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Red Hat Enterprise Linux Server release 6.7 (Santiago)
Red Hat Enterprise Linux Server release 6.7 (Santiago)
I start build my application, for build we use cmake, that also include cmake from gcc:
add_subdirectory(/path/gtest/ ${PROJECT_BINARY_DIR})
add_executable(myApplication ${SOURCES})
add_dependencies(myApplication tinyxml2 gtest)
target_link_libraries(myApplication tinyxml2 gtest ${CMAKE_DL_LIBS})
During application build I do not have any error. After build i try execute application and have an error: Segmentation fault
During analysis i found that myApplication and gtest have different OS/ABI version:
myApplication: UNIX - System V
gtest: UNIX - Linux
tinyXML2: UNIX - System V
other binary and library also have: UNIX - System V
Do you know how i can fix this problem?
GCC version: 4.8.2

Resources