Cant build V8 with GYP successfully on Mac OSX - gcc

I followed V8 Build Instructions from here
Here are the steps that I'm following to build V8 on Mac OSX.
1. git clone git://github.com/v8/v8.git v8-src && cd v8-src
2. make dependencies
3. make x64 -j8 library=shared snapshot=on console=readline
But I do not see out/x64.release/obj.target/tools/gyp/libv8_base.x64.a (or snapshot.a)
The Folder only contains js2c.stamp
Here is the Gist: Build Output
What am I doing wrong ..

Ok, the documentation specifies the location for Linux Machines. For Mac OSX, these files are here :
out/x64.release/libv8_base.x64.a (& snapshot.a)
Finally, compile your C++ Module, by linking V8, as below:
g++ -Iinclude test.cc -o test out/x64.release/libv8_{base.x64,snapshot}.a -lpthread

Related

Standalone build of DPDK on Windows fails for examples application

Building the example application skeleton or l2fwd or l3fwd via DPDK meson with option -Dexamples=, creates the binary executable without any warnings or error. But executing the same example as standalone build leads to DPDK build error
C:\dpdk\dpdk-21.02\examples\skeleton>gcc basicfwd.c -include rte_config.h -march=native -IC:/include -Wl,--as-needed -LC:/lib -lrte_cfgfile -lrte_hash -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_rcu -lrte_ring -lrte_eal -lrte_telemetry -lrte_kvargs
In file included from C:/include/rte_eal.h:21,
from basicfwd.c:7:
C:/include/rte_bus.h:22:10: fatal error: sys/queue.h: No such file or directory
#include <sys/queue.h>
^~~~~~~~~~~~~
compilation terminated.
Expectation:
C:\dpdk\dpdk-21.02\examples\skeleton>dir
Directory of C:\dpdk\dpdk-21.02\examples\skeleton
<DIR> .
<DIR> ..
163,348 a.exe
5,458 basicfwd.c
1,511 Makefile
322 meson.build
Steps to reproduce the error
Platform: x86_64, Intel E5 2680 Xeon
OS: windows server 2019
DPDK version: 21.02
Meson version: 0.57.1
Ninja version: 1.10.2
Pkg-config version: 0.26
Steps followed: http://doc.dpdk.org/guides/windows_gsg/index.html
compiler flags: execute pkg-config --cflags --libs libdpdk
There is a difference in the CFLAGS and LDFLAGS when one uses meson meson -Dexamples=l2fwd build and meson build. In the former scenario, the dependency is pulled from DPDK root folder directly and direct link to lib/librte_eal/windows/include. But when DPDK pkg has installed the files under lib/librte_eal/windows/include are not copied over which causes build failure.
Checking meson.build in lib/librte_eal/windows/ reveals the only install is for 'rte_os.h', 'rte_virt2phys.h', and 'rte_windows.h'. Folder 'netinet' and 'sys' are skipped. Based on the update from DPDK maintainer, since DPDK on windows is experimental only validation done is with meson -Dexamples=l2fwd build. Hence as temporary work around is to use -I[DPDK folder]\lib\librte_eal\windows\include\
Note:
Thanks to #stackinside for the comment
working on DPDK patch to plug the missing files.

Error while compiling Halide program using Linux command in Windows environment through Cygwin

I downloaded Halide binaries for Linux. For compiling the tutorial programs(especially the autoscheduler program), I need to install g++ version 5.3. But, I am not able to install this particular version. How to solve the problem? Please find the instructions below copied from the link : https://github.com/halide/Halide/releases
Update 1:
I ran the command sudo apt install g++-5.3 . I got the error "Unable to locate the package g++5.3"
Update 2:
These are some of the errors I get.
Update 4:
I want to run this program :
https://halide-lang.org/tutorials/tutorial_lesson_21_auto_scheduler_generate.html.
The linux command is given at the very top of the above link. I am pasting it below:
g++ lesson_21_auto_scheduler_generate.cpp ../tools/GenGen.cpp -g -std=c++11 -fno-rtti -I ../include -L ../bin -lHalide -lpthread -ldl -o lesson_21_generate
Additionally, I moved the "libHalide.a" file from the lib folder to the bin folder and executed the commmand.
The problem is that you're on Windows, as your references to x86_64-pc-cygwin and /cygdrive/c in your screenshot indicate, but you're trying to use the Linux binaries. Cygwin is only source-compatible with Linux programs, not binary-compatible. Here's your choices:
Use the Windows or MinGW downloads instead of the Linux ones (you may have to switch to MinGW)
In Ubuntu in VirtualBox, just install g++ instead of g++-5.3, and then use the Linux download there

Building clang from source code on Ubuntu and Windows

Its been a While that I tried to build clang from source code.
I tried with 2 platforms
a> Ubuntu
b> Windows
I am following the link http://clang.llvm.org/docs/LibASTMatchersTutorial.html
Ubuntu
$ mkdir build
$ cd build
$ cmake -GNinja -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ /path/to/source/llvm
After this in build directory ninja.build files generated along with some more folder
$ ninja after this command inside build directory bin folder can be seen and it contains all the clang executables clang,clang++,clang-check and many more.
Windows
I tried every option that is available to build clang from source
I am trying on developer command prompt and also I am having VS Express edition
> mkdir build
> cd build
> cmake -GNinja -DCMAKE_BUILD_TYPE=release -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ path-to-llvm
It throws error
Host compiler appears to require libatomic,but cannot find it.
So I tried in the another way by making DCMAKE_CXX_COMPILER and DCMAKE_C_COMPILER as clang-cl.exe
> cmake -GNinja -DCMAKE_BUILD_TYPE=release -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe path-to-llvm
It didnt show any error at first but later while building
atlbase.h file not found
Why it is that much difficult to build clang from source on windows.?
Is this the correct procedure that I am doing?
Kindly help with any solution.

opencv library installation on windows

I found this project on github that requires the opencv library. The author has given the following instruction for linux and osx but none for windows:
I tried using the linux commands on windows but it gave me an error at cmake, saying
cmake command not found. So i downloaded cmake and tried running it again it still continues to give the same error.
Can someone advise on how to get this working? Or point me to some other way to install the library?
OSX
cd ~
git clone git://code.opencv.org/opencv.git
cd opencv
git checkout 2.4.5
mkdir build
cd build
cmake -G "Unix Makefiles" -D CMAKE_OSX_ARCHITECTURES=x86_64 ..
make -j8
sudo make install
Linux (Tested on Ubuntu 12.04)
cd ~
git clone git://code.opencv.org/opencv.git
cd opencv
git checkout 2.4.5
mkdir build
cd build
cmake -G "Unix Makefiles" ..
make -j8
sudo make install
Compiling PuzzleSolver
Once the opencv library has been installed, you can try to open the xcodeproject, or on linux or mac run this from the PuzzleSolver directory (with the source files):
g++ -O3 `pkg-config --cflags opencv` -o PuzzleSolver *.cpp `pkg-config --libs opencv`
This will result in an executable called PuzzleSolver.
just get the binary pack [~400mb]

OSX 10.7.4 w/XCode 4.4.1 & GCC (Issues w/compiling straight C/C++)

The issue I'm having is that gcc (and family) don't appear to be properly setup. I have a 10.7.4 machine that I just installed Xcode on (from the app store). I've done no prior development on this machine.
Working w/in Xcode seems to work fine. I can build and compile no problem. However, trying to execute gcc command line fails.
First, I gcc wasn't on my path ... no big deal. I located it and ran as:
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -dynamiclib -fno-common -o s.dylib s.c
(I'm working on a lib w/some functions...). Anyways, it fails.
s.c:1:19: error: stdio.h: No such file or directory
s.c:2:20: error: stdlib.h: No such file or directory
s.c:3:20: error: string.h: No such file or directory
Surprise! hah, well I searched my machine for stdio.h and I can't find it anywhere. Since I've been out of the OSX game for a bit, I'm assuming I'm missing something -
Basically I want to be able to continue using Xcode but I want to be able to build C/C++/etc on the command line with all the dependencies (.h) in the correct place.
Any thoughts?
There are two main ways to run the compiler from the command line: the Command Line Tools package, and xcrun.
xcrun is particularly good if you just need this occasionally. Just stick "xcrun" at the start, like you'd do with sudo:
xcrun gcc -dynamiclib -fno-common -o s.dylib s.c
This will find the correct version of gcc and set the needed directories, etc. You can specify a specific SDK with --sdk.
If you do this a lot, download and install the Command Line Tools package (Xcode>Open Developer Tool>More Tools...; it also may be available in Preferences>Downloads). This installs a full copy of everything in /usr.
Probably xcrun is not enough if you are using 10.8.
Looking in to the clang documentation I found that you need to include the system root because you do not have your libraries in the standard place but inside Xcode.
using:
xcrun gcc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
or:
xcrun clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk

Resources