configure script and ldid - ios

The excerpt form the configure scripts fails due to Killed: 9 error, which is that iOS 5 can only run signed apps. So I need to find a way to put ldid -s some where in these tests, only problem is where.
Anyone???
fails with
checking build system compiler gcc... no
checking build system compiler gcc -g -O2 ... no
checking build system compiler cc... no
checking build system compiler gcc... no
checking build system compiler c89... no
checking build system compiler c99... no
configure: error: Cannot find a build system compiler
and config.log
onfigure:15586: gcc -c -g -O2 conftest.c >&5
configure:15586: $? = 0
configure:15586: result: yes
configure:15586: checking sys/time.h presence
configure:15586: gcc -E conftest.c
configure:15586: $? = 0
configure:15586: result: yes
configure:15586: checking for sys/time.h
configure:15586: result: yes
configure:15677: checking build system compiler gcc
configure:15690: gcc conftest.c
conftest.c: In function 'main':
conftest.c:4: warning: incompatible implicit declaration of built-in function 'exit'
configure:15693: $? = 0
./configure: line 15675: 27218 Killed: 9 ./a.out
./configure: line 15695: ./b.out: No such file or directory
./configure: line 15695: ./a.exe: No such file or directory
./configure: line 15695: ./a_out.exe: No such file or directory
./configure: line 15695: ./conftest: No such file or directory
configure:15700: result: no
configure:15677: checking build system compiler gcc -g -O2
configure:15690: gcc -g -O2 conftest.c
conftest.c: In function 'main':
conftest.c:4: warning: incompatible implicit declaration of built-in function 'exit'
configure:15693: $? = 0
./configure: line 15675: 27234 Killed: 9 ./a.out
./configure: line 15695: ./b.out: No such file or directory
./configure: line 15695: ./a.exe: No such file or directory
./configure: line 15695: ./a_out.exe: No such file or directory
./configure: line 15695: ./conftest: No such file or directory
configure:15700: result: no
And finally the ./configure script..
if test -n "$CC_FOR_BUILD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system compiler $CC_FOR_BUILD" >&5
$as_echo_n "checking build system compiler $CC_FOR_BUILD... " >&6; }
# remove anything that might look like compiler output to our "||" expression
rm -f conftest* a.out b.out a.exe a_out.exe
cat >conftest.c <<EOF
int
main ()
{
exit(0);
}
EOF
gmp_compile="$CC_FOR_BUILD conftest.c"
cc_for_build_works=no
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5
(eval $gmp_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
if (./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest) >&5 2>&1; then
cc_for_build_works=yes
fi
fi
rm -f conftest* a.out b.out a.exe a_out.exe
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cc_for_build_works" >&5
$as_echo "$cc_for_build_works" >&6; }
if test "$cc_for_build_works" = yes; then
:
else
as_fn_error $? "Specified CC_FOR_BUILD doesn't seem to work" "$LINENO" 5
fi
elif test -n "$HOST_CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system compiler $HOST_CC" >&5
$as_echo_n "checking build system compiler $HOST_CC... " >&6; }
# remove anything that might look like compiler output to our "||" expression
rm -f conftest* a.out b.out a.exe a_out.exe
cat >conftest.c <<EOF
int
main ()
{
exit(0);
}

I have to admit that my ability to read anything but the simplest shell scripts is pretty poor, but basically, you need to fake codesign the executable before you run it. It looks like the executable you want to run is called conftest, right? So, try signing it in this block:
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5
(eval $gmp_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
#begin added code
ldid -S ./conftest
#end added code
if (./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest) >&5 2>&1; then
cc_for_build_works=yes
fi
fi
Obviously, you might need to supply the full path to ldid (e.g. /usr/bin/ldid) if it's not found in the existing PATH.
Update: per poster's comment below, a.out is actually the executable that needs to be signed, not conftest.

Related

How to build open3d from source on l4t-base:r32.5.0 IMG?

I've been trying to build open3d from source on the l4t-base:r32.5.0 IMG from NVIDIA for quite some time now and have basically searched the whole internet for a script/guide, but I can't seem to find anything or get it to work myself.
Following the exact steps stated on http://www.open3d.org/docs/release/arm.html I get the following output while running the following Dockerfile
Dockerfile
FROM dustynv/ros:foxy-ros-base-l4t-r32.5.0
WORKDIR /workspace
##########################
### CMAKE INSTALLATION ###
##########################
RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.6/cmake-3.20.6-linux-aarch64.tar.gz
RUN tar -v -xzf cmake-3.20.6-linux-aarch64.tar.gz
RUN mv cmake-3.20.6-linux-aarch64 cmake
RUN echo "alias cmake='/workspace/cmake/bin/cmake'" >> /root/.bashrc
RUN source /root/.bashrc && cmake --version
#################################
### OPEN3D 0.13.0 INSTALLTION ###
#################################
RUN wget https://github.com/isl-org/Open3D/archive/refs/tags/v0.13.0.tar.gz
RUN tar -v -xzf v0.13.0.tar.gz
RUN mv Open3D-0.13.0 open3d
RUN apt-get update && apt-get install xorg-dev libglu1-mesa-dev -y
RUN cd open3d && mkdir build && cd build && \
/workspace/cmake/bin/cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_CUDA_MODULE=OFF \
-DBUILD_GUI=OFF \
-DBUILD_TENSORFLOW_OPS=OFF \
-DBUILD_PYTORCH_OPS=OFF \
-DBUILD_UNIT_TESTS=ON \
-DCMAKE_INSTALL_PREFIX=~/open3d_install \
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
..
ErrorLog
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /workspace/open3d/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_d15b1/fast && /usr/bin/make -f CMakeFiles/cmTC_d15b1.dir/build.make CMakeFiles/cmTC_d15b1.dir/build
make[1]: Entering directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_d15b1.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -fPIE -o CMakeFiles/cmTC_d15b1.dir/src.c.o -c /workspace/open3d/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_d15b1
/workspace/cmake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d15b1.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_d15b1.dir/src.c.o -o cmTC_d15b1
CMakeFiles/cmTC_d15b1.dir/src.c.o: In function `main':
src.c:(.text+0x48): undefined reference to `pthread_create'
src.c:(.text+0x50): undefined reference to `pthread_detach'
src.c:(.text+0x58): undefined reference to `pthread_cancel'
src.c:(.text+0x64): undefined reference to `pthread_join'
src.c:(.text+0x74): undefined reference to `pthread_atfork'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_d15b1.dir/build.make:98: recipe for target 'cmTC_d15b1' failed
make[1]: *** [cmTC_d15b1] Error 1
make[1]: Leaving directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Makefile:127: recipe for target 'cmTC_d15b1/fast' failed
make: *** [cmTC_d15b1/fast] Error 2
Source file was:
#include <pthread.h>
static void* test_func(void* data)
{
return data;
}
int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);
return 0;
}
Looking for a ASM_NASM compiler failed with the following output:
-- The ASM_NASM compiler identification is unknown
-- Didn't find assembler
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_ASM_NASM_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "ASM_NASM" or the CMake cache entry CMAKE_ASM_NASM_COMPILER to the
full path to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "/workspace/open3d/build/CMakeFiles/CheckASM_NASM/CMakeFiles/CMakeOutput.log".
See also "/workspace/open3d/build/CMakeFiles/CheckASM_NASM/CMakeFiles/CMakeError.log".
Determining if the function sgemm_ exists failed with the following output:
Change Dir: /workspace/open3d/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_855e0/fast && /usr/bin/make -f CMakeFiles/cmTC_855e0.dir/build.make CMakeFiles/cmTC_855e0.dir/build
make[1]: Entering directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_855e0.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=sgemm_ -fPIE -o CMakeFiles/cmTC_855e0.dir/CheckFunctionExists.c.o -c /workspace/cmake/share/cmake-3.20/Modules/CheckFunctionExists.c
Linking C executable cmTC_855e0
/workspace/cmake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_855e0.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=sgemm_ CMakeFiles/cmTC_855e0.dir/CheckFunctionExists.c.o -o cmTC_855e0
CMakeFiles/cmTC_855e0.dir/CheckFunctionExists.c.o: In function `main':
CheckFunctionExists.c:(.text+0x10): undefined reference to `sgemm_'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_855e0.dir/build.make:98: recipe for target 'cmTC_855e0' failed
make[1]: *** [cmTC_855e0] Error 1
make[1]: Leaving directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Makefile:127: recipe for target 'cmTC_855e0/fast' failed
make: *** [cmTC_855e0/fast] Error 2
Determining if the function cheev_ exists failed with the following output:
Change Dir: /workspace/open3d/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_3a46a/fast && /usr/bin/make -f CMakeFiles/cmTC_3a46a.dir/build.make CMakeFiles/cmTC_3a46a.dir/build
make[1]: Entering directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_3a46a.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=cheev_ -fPIE -o CMakeFiles/cmTC_3a46a.dir/CheckFunctionExists.c.o -c /workspace/cmake/share/cmake-3.20/Modules/CheckFunctionExists.c
Linking C executable cmTC_3a46a
/workspace/cmake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3a46a.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=cheev_ CMakeFiles/cmTC_3a46a.dir/CheckFunctionExists.c.o -o cmTC_3a46a /usr/lib/aarch64-linux-gnu/libblas.so -pthread -lm -ldl
CMakeFiles/cmTC_3a46a.dir/CheckFunctionExists.c.o: In function `main':
CheckFunctionExists.c:(.text+0x10): undefined reference to `cheev_'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_3a46a.dir/build.make:99: recipe for target 'cmTC_3a46a' failed
make[1]: *** [cmTC_3a46a] Error 1
make[1]: Leaving directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Makefile:127: recipe for target 'cmTC_3a46a/fast' failed
make: *** [cmTC_3a46a/fast] Error 2
Determining if the function LAPACKE_dgeqrf exists failed with the following output:
Change Dir: /workspace/open3d/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_9905d/fast && /usr/bin/make -f CMakeFiles/cmTC_9905d.dir/build.make CMakeFiles/cmTC_9905d.dir/build
make[1]: Entering directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_9905d.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=LAPACKE_dgeqrf -fPIE -o CMakeFiles/cmTC_9905d.dir/CheckFunctionExists.c.o -c /workspace/cmake/share/cmake-3.20/Modules/CheckFunctionExists.c
Linking C executable cmTC_9905d
/workspace/cmake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9905d.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=LAPACKE_dgeqrf CMakeFiles/cmTC_9905d.dir/CheckFunctionExists.c.o -o cmTC_9905d /usr/lib/aarch64-linux-gnu/liblapack.so /usr/lib/aarch64-linux-gnu/libblas.so
CMakeFiles/cmTC_9905d.dir/CheckFunctionExists.c.o: In function `main':
CheckFunctionExists.c:(.text+0x10): undefined reference to `LAPACKE_dgeqrf'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_9905d.dir/build.make:100: recipe for target 'cmTC_9905d' failed
make[1]: *** [cmTC_9905d] Error 1
make[1]: Leaving directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Makefile:127: recipe for target 'cmTC_9905d/fast' failed
make: *** [cmTC_9905d/fast] Error 2
Problem:
I want to build open3d from source on an arm docker img with a Dockerfile. More specifically, the l4t-base:r32.5.0 img provided by NVIDIA. This image will be used on a Jetson XavierNX with docker installed.
Above you can see what I have tried so far in terms of Dockerfile and the output this gives me.
What I am asking is, if anyone has a Dockerfile for building open3d from source on an arm based image or knows how to do it successfully, because I cannot seem to be able to do it.

How to build boost 1.56.0 boost::context for iphone (ARM)

I'm trying to build boost for iOS development and I found a auto build script on github.
Most libraries build fine and I got a boost.a. I have the asio library tested, it works.
But the boost::coroutine build fails, in fact the boost::context build fails with this error.
darwin.compile.c++ iphone-build/boost/bin.v2/libs/context/build/darwin-8.1~iphone/release/architecture-arm/link-static/macosx-version-iphone-8.1/target-os-iphone/threading-multi/unsupported.o
libs/context/src/unsupported.cpp:7:2: error: "platform not supported"
#error "platform not supported"
^
1 error generated.
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" "-arch" "armv7" "-arch" "armv7s" "-arch" "arm64" "-fvisibility=hidden" "-fvisibility-inlines-hidden" "-DBOOST_AC_USE_PTHREADS" "-DBOOST_SP_USE_PTHREADS" "-std=c++11" "-stdlib=libc++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -gdwarf-2 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -pthread -arch arm -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTEXT_SOURCE -DNDEBUG -D_LITTLE_ENDIAN -I"." -c -o "iphone-build/boost/bin.v2/libs/context/build/darwin-8.1~iphone/release/architecture-arm/link-static/macosx-version-iphone-8.1/target-os-iphone/threading-multi/unsupported.o" "libs/context/src/unsupported.cpp"
...failed darwin.compile.c++ iphone-build/boost/bin.v2/libs/context/build/darwin-8.1~iphone/release/architecture-arm/link-static/macosx-version-iphone-8.1/target-os-iphone/threading-multi/unsupported.o...
And the boost::context requirements says we should
specify certain additional properties at bjam command line: target-os, abi, binary-format, architecture and address-model.
I change build script's bjam command line from
./bjam -j16 --build-dir=iphone-build -sBOOST_BUILD_USER_CONFIG=$BOOST_SRC/tools/build/example/user-config.jam --stagedir=iphone-build/stage --prefix=$PREFIXDIR toolset=darwin architecture=arm target-os=iphonemacosx-version=iphone-${IPHONE_SDKVERSION} define=_LITTLE_ENDIAN link=static stage > "${LOG}" 2>&1
to
./bjam -j16 --build-dir=iphone-build -sBOOST_BUILD_USER_CONFIG=$BOOST_SRC/tools/build/example/user-config.jam --stagedir=iphone-build/stage --prefix=$PREFIXDIR toolset=darwin abi=aapcs binary-format=mach-o address-model=32 architecture=arm target-os=iphone macosx-version=iphone-${IPHONE_SDKVERSION} define=_LITTLE_ENDIAN link=static stage > "${LOG}" 2>&1
now the compiler doing the right thing but I got another error
darwin.compile.asm iphone-build/boost/bin.v2/libs/context/build/darwin-8.1~iphone/release/abi-aapcs/address-model-32/architecture-arm/link-static/macosx-version-iphone-8.1/target-os-iphone/threading-multi/asm/jump_arm_aapcs_macho_gas.o
libs/context/src/asm/jump_arm_aapcs_macho_gas.S:94:11: error: invalid operand for instruction
pop v1
^
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" "-arch" "armv7" "-arch" "armv7s" "-arch" "arm64" "-fvisibility=hidden" "-fvisibility-inlines-hidden" "-DBOOST_AC_USE_PTHREADS" "-DBOOST_SP_USE_PTHREADS" "-std=c++11" "-stdlib=libc++" -x assembler-with-cpp -O3 -finline-functions -Wno-inline -Wall -gdwarf-2 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -arch arm -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTEXT_SOURCE -DNDEBUG -D_LITTLE_ENDIAN -I"." -c -o "iphone-build/boost/bin.v2/libs/context/build/darwin-8.1~iphone/release/abi-aapcs/address-model-32/architecture-arm/link-static/macosx-version-iphone-8.1/target-os-iphone/threading-multi/asm/jump_arm_aapcs_macho_gas.o" "libs/context/src/asm/jump_arm_aapcs_macho_gas.S"
`
Not just pop v1, and lots of other compile errors and after read the clang's Cross-compilation doc,
I decide to add -target arm-macho to auto script line 213.
Now, only one error pop v1 and 8 warnings like these:
clang: warning: unknown platform, assuming -mfloat-abi=soft
clang: warning: argument unused during compilation: '-arch armv7'
clang: warning: argument unused during compilation: '-stdlib=libc++'
clang: warning: argument unused during compilation: '-arch arm'
I know a little x86 asm and I read the libs/context/src/asm/jump_arm_aapcs_macho_gas.S, it seems that pop v1 should be pop {v1}, I don't know ARM asm, whatever, I just wanna make this pass and check error later.
So I change libs/context/src/asm/jump_arm_aapcs_macho_gas.S:94
from pop v1 to pop {v1} and build this again it finally works fine.
But just the context and coroutine library build fine. Other library such as libs/atomic/src/lockpool.cpp fails with error
libs/atomic/src/lockpool.cpp:15:10: fatal error: 'cstddef' file not found
As a dummy donkey, I'm out of skills.
Can somebody help me about this?
I should link all references, but my reputation is less than 10. I cannot post more than 2 links.
I just managed to build Boost.Context (1.59.0) with some modifications to the solution as provided by ofxiOSBoost from GitHub.
The problems with the original solution against building Boost.Context are:
the build script hard-codes the darwin toolset to use "clang++", which can only build pure C++ code, not the assembly code
as you have already figured out, the b2 command line as supplied by the build script doesn't include all the requirements to build Boost.Context, namely: abi, address-model, architecture, binary-format, these requirements are used to match the correct assembly source files inside "context/build/Jamfile.v2"
Even after you correctly specify all of the requirements, you still get compilation errors, which are actually generated from attempting to use the hardcoded clang++ to compile the assembly source code - btw, you should not modify the original assembly source code to just see it compiles.
Inside context/build/Jamfile.v2, you have to build the assembly code inline, instead of using clang++. Fortunately, there are some nice examples inside the same file teaching you how to build the assembly source code inline, so eventually clang++ will just see the generated object files, and the rest of the toolchain pipeline can happily consume them.
I am pasting the modifications I made in the Boost.Context Jamfile below (you should be smart enough to figure out where to put those sections):
actions gasarmv7
{
cpp -x assembler-with-cpp "$(>)" | as -arch armv7 -o "$(<)"
}
actions gasarm64
{
cpp -x assembler-with-cpp "$(>)" | as -arch arm64 -o "$(<)"
}
-
# ARM DARWIN 32_64
alias asm_context_sources
: [ make asm/make_arm_aapcs_macho_gas.o : asm/make_arm_aapcs_macho_gas.S : #gasarmv7 ]
[ make asm/jump_arm_aapcs_macho_gas.o : asm/jump_arm_aapcs_macho_gas.S : #gasarmv7 ]
[ make asm/make_arm64_aapcs_macho_gas.o : asm/make_arm64_aapcs_macho_gas.S : #gasarm64 ]
[ make asm/jump_arm64_aapcs_macho_gas.o : asm/jump_arm64_aapcs_macho_gas.S : #gasarm64 ]
: <abi>aapcs
<address-model>32_64
<architecture>arm
<binary-format>mach-o
<toolset>darwin
;
And below are the modifications to the build-libc++.sh:
Boost 1.58.0+ is recommended, since it Boost.Context added support for arm64
BOOST_V1=1.59.0
BOOST_V2=1_59_0
-
buildBoostForIPhoneOS()
{
cd $BOOST_SRC
# Install this one so we can copy the includes for the frameworks...
set +e
echo "------------------"
LOG="$LOGDIR/build-iphone-stage.log"
echo "Running bjam for iphone-build stage"
echo "To see status in realtime check:"
echo " ${LOG}"
echo "Please stand by..."
./bjam -j${PARALLEL_MAKE} --build-dir=iphone-build -sBOOST_BUILD_USER_CONFIG=$BOOST_SRC/tools/build/example/user-config.jam --stagedir=iphone-build/stage --prefix=$PREFIXDIR --toolset=darwin-${IPHONE_SDKVERSION}~iphone cxxflags="-stdlib=$STDLIB" variant=release linkflags="-stdlib=$STDLIB" architecture=arm address-model=32_64 abi=aapcs binary-format=mach-o target-os=iphone macosx-version=iphone-${IPHONE_SDKVERSION} define=_LITTLE_ENDIAN link=static stage > "${LOG}" 2>&1
if [ $? != 0 ]; then
tail -n 100 "${LOG}"
echo "Problem while Building iphone-build stage - Please check ${LOG}"
exit 1
else
echo "iphone-build stage successful"
fi
echo "------------------"
LOG="$LOGDIR/build-iphone-install.log"
echo "Running bjam for iphone-build install"
echo "To see status in realtime check:"
echo " ${LOG}"
echo "Please stand by..."
./bjam -j${PARALLEL_MAKE} --build-dir=iphone-build -sBOOST_BUILD_USER_CONFIG=$BOOST_SRC/tools/build/example/user-config.jam --stagedir=iphone-build/stage --prefix=$PREFIXDIR --toolset=darwin-${IPHONE_SDKVERSION}~iphone cxxflags="-stdlib=$STDLIB" variant=release linkflags="-stdlib=$STDLIB" architecture=arm address-model=32_64 abi=aapcs binary-format=mach-o target-os=iphone macosx-version=iphone-${IPHONE_SDKVERSION} define=_LITTLE_ENDIAN link=static install > "${LOG}" 2>&1
if [ $? != 0 ]; then
tail -n 100 "${LOG}"
echo "Problem while Building iphone-build install - Please check ${LOG}"
exit 1
else
echo "iphone-build install successful"
fi
doneSection
echo "------------------"
LOG="$LOGDIR/build-iphone-simulator-build.log"
echo "Running bjam for iphone-sim-build "
echo "To see status in realtime check:"
echo " ${LOG}"
echo "Please stand by..."
./bjam -j${PARALLEL_MAKE} --build-dir=iphonesim-build -sBOOST_BUILD_USER_CONFIG=$BOOST_SRC/tools/build/example/user-config.jam --stagedir=iphonesim-build/stage --toolset=darwin-${IPHONE_SDKVERSION}~iphonesim architecture=x86 address-model=32_64 binary-format=mach-o abi=sysv target-os=iphone variant=release macosx-version=iphonesim-${IPHONE_SDKVERSION} link=static stage > "${LOG}" 2>&1
if [ $? != 0 ]; then
tail -n 100 "${LOG}"
echo "Problem while Building iphone-simulator build - Please check ${LOG}"
exit 1
else
echo "iphone-simulator build successful"
fi
doneSection
}
Pay special attention to the b2 command lines above (the requirements are specified there to match the Boost.Context Jamfile.v2 changes.
Also, as the original build script always tries to download and unpack the boost archive, so you need to might want to save the modifications to the Boost.Context Jamfile.v2 somewhere and re-apply it, or for the second run (after downloading, unpacking, and patching boost for at least once):
#cleanEverythingReadyToStart #may want to comment if repeatedly running during dev
#restoreBoost
#downloadBoost
#unpackBoost
#inventMissingHeaders
prepare
bootstrapBoost
#updateBoost
buildBoostForIPhoneOS
scrunchAllLibsTogetherInOneLibPerPlatform
buildIncludes
#restoreBoost
#postcleanEverything
Again, please get latest version from https://github.com/danoli3/ofxiOSBoost and use Boost 1.59.0
Hope this helps!

compiling with HDF5: unable to link library files (fortran 90)

I am currently try to compile these files using HDF5
I have directly linked and included everything necessary ( I think) but still the compile unable to find the files that is needed
This is my Makefile:
CC = h5cc
FC = h5fc
LD = h5fc
FDEBUG = -std -g -traceback
CFLAGS = -g -O0 -Wall -pedantic
FFLAGS = -g -O0 -Wall -I$(H5DIR)/include -L$(H5DIR)/lib/libhdf5hl_fortran.a
LDFLAGS = -I$(H5DIR)/include -L$(H5DIR)/lib/libhdf5hl_fortran.a
#LDFLAGS = -I$(MKLROOT)/include -L$(MKLROOT) -mkl=sequential
# -opt-block-factor=16 -opt-prefetch=4 \
.SUFFIXES:
.SUFFIXES: .c .f .f90 .F90 .o
OBJS = timing.o \
kinds.o \
rw_matrix.o \
EXE = matmul_omp.exe
all: $(EXE)
$(EXE): $(OBJS) matmul_omp.o
$(LD) $(LDFLAGS) -o $# $^
.f90.o:
-$(RM) -f $*.o $*.mod
$(FC) $(FFLAGS) -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
.PHONEY: clean
clean:
THis is the err:
h5fc -I/curc/tools/x_86_64/rh6/hdf5/1.8.13/szip/2.1/zlib/1.2.8/jpeglib/9a/openmpi/1.8.2/intel/13.0.0/include -L/curc/tools/x_86_64/rh6/hdf5/1.8.13/szip/2.1/zlib/1.2.8/jpeglib/9a/openmpi/1.8.2/intel/13.0.0/lib/libhdf5hl_fortran.a -o matmul_omp.exe timing.o matmul_omp.o
gfortran: /usr/lib64/libhdf5hl_fortran.a: No such file or directory
gfortran: /usr/lib64/libhdf5_hl.a: No such file or directory
gfortran: /usr/lib64/libhdf5_fortran.a: No such file or directory
gfortran: /usr/lib64/libhdf5.a: No such file or directory
As you can see that I directly link libhdf5hl_fortran.a. but i dont know why the error is giving a different directory /usr/lib64/
I think you have a couple of things wrong here.
If you are using h5fc then you shouldn't need to add all the include and lib paths. That is the whole point of the helper applications.
You are adding the paths that have Intel, yet your h5fc has a GNU (gfortran) error.
The gfortran build of HDF5 looks as if it does not have the fortran bindings built.
I would suggest trying the following. Using the full paths (as you have done) but call ifort instead of h5fc:
ifort -I/curc/tools/x_86_64/rh6/hdf5/1.8.13/szip/2.1/zlib/1.2.8/jpeglib/9a/openmpi/1.8.2/intel/13.0.0/include \
-L/curc/tools/x_86_64/rh6/hdf5/1.8.13/szip/2.1/zlib/1.2.8/jpeglib/9a/openmpi/1.8.2/intel/13.0.0/lib/libhdf5hl_fortran.a \
-o matmul_omp.exe timing.o matmul_omp.o

RT5370 SH4 Cross Compile Driver Errors

I try to build 2.5.0.3 driver from file 2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO.bz2 to RT5370 chipset.
Install STLinux 2.4 under Ubuntu 10.04.4 x32, make under kernel linux-sh4-2.5.32.59_stm24_0211. But I wrote /opt/STM/STLinux-2.2/devkit/sources/kernel/linux-sh4-2.5.32.59_stm24_0211 in path instead of STLinux-2.4, because Makefile have some defects:
install:
ifeq ($(TARGET), LINUX)
ifneq (,$(findstring 2.4,$(LINUX_SRC)))
$(MAKE) -C $(RT28xx_DIR)/os/linux -f Makefile.4 install
else
$(MAKE) -C $(RT28xx_DIR)/os/linux -f Makefile.6 install
endif
endif
The mention in a path 2.4 build a kernel as 2.4 that in my case a mistake.
Wrote in Makefile:
PLATFORM = ST
...
LINUX_SRC = /opt/STM/STLinux-2.2/devkit/sources/kernel/linux-sh4-2.5.32.59_stm24_0211
CROSS_COMPILE = /opt/STM/STLinux-2.2/devkit/sh4/bin/sh4-linux-
In ./os/linux/config.mk wrote:
HAS_WPA_SUPPLICANT=y
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
CC := sh4-linux-gcc
LD := sh4-linux-ld
Build at run make command. But have the error:
script/Makefile.build:49: *** CFLAGS was changed in "/home/vitaliy/drv_src/os/linux/Makefile". Fix it to use EXTRA_CFLAGS.
Founded strings at ./os/linux/config.mk:
ifeq ($(PLATFORM),ST)
CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -Wall -O2 -Wundef -Wstrict-prototypes -Wno-trigraphs -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-aliasing -fno-common -fomit-frame-pointer -ffreestanding -m4-nofpu -o $(WFLAGS)
export CFLAGS
endif
And change CFLAGS to EXTRA_CFLAGS in them.
Again error:
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible.
Ok. Remove flag -fomit-frame-pointer.
Again error:
error: cpu/cache.h: No such file or directory.
In string:
WFLAGS := -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT -DLINUX -Wall -Wstrict-prototypes -Wno-trigraphs
Remove flag -DLINUX.
Again error with unknown types (for example: ./os/linux/../../common/crypt_md5.c:638:1: error: unknown type name 'VOID' and so on with types 'UCHAR', 'ULONG' etc).
Second way to build with help of
KBUILD_NOPEDANTIC=1 make without changes in sources files of drivers.
Error in this case too:
./os/linux/../../common/crypt_md5.c:28:23: fatal error: rt_config.h: No such file or directory.
What is wrong in my building? Or can I fix sources code and build driver for SH4-platform.
Thank you!
I recently got myself the same adapter, and I was trying to cross compile for ARM, and run into the same problem.
Basically, you just have to add the include folder from the root of the driver package.
I did these modifications to get it working:
in DRIVER_DIR/Makefile, added:
PLATFORM = MYPLATFORM
All other platforms are commented out.
Later in same file:
ifeq ($(PLATFORM),MYPLATFORM)
LINUX_SRC = /DIR_TO_MY_KERNEL_SRC/freescale_mainline/linux-mainline
CROSS_COMPILE = /DIR_TO_MY_CROSS_COMPILER/arm-unknown-linux-uclibcgnueabi-
CROSS_COMPILE_INCLUDE = /DRIVER_DIR/include /*Might not be necessary*/
endif
Then in DRIVER_DIR/os/linux/config.mk, added:
ifeq ($(PLATFORM),MYPLATFORM)
EXTRA_CFLAGS := $(WFLAGS) -I$(RT28xx_DIR)/include
endif
Also, please note that in your kernel configuration you need to have couple of flags enabled:
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_WEXT_SPY=y
CONFIG_WEXT_PRIV=y
You can find them under Device Drivers-->Network Device Support-->Wireless LAN-->IEEE 802.11 for Host AP
I compile it just like this now:
DRIVER_DIR$ ARCH=arm make
Hope it helps!

Port -v self update can't find cc

MBP (10.7.3) Xcode 4.3.1 works, it compiles a c program.
ran sudo port -v selfupdate
BELOW is part of the console.log
configure:2735: result: i386-apple-darwin11.3.0
configure:2763: checking MacPorts version
configure:2766: result: 2.0.4
configure:2799: checking for sw_vers
configure:2817: found /usr/bin/sw_vers
configure:2829: result: /usr/bin/sw_vers
configure:2839: checking for defaults
configure:2857: found /usr/bin/defaults
configure:2869: result: /usr/bin/defaults
configure:2879: checking for xcode-select
configure:2897: found /usr/bin/xcode-select
configure:2909: result: /usr/bin/xcode-select
configure:2919: checking Mac OS X version
configure:2922: result: 10.7.3
configure:2945: checking Xcode location
configure:2948: result: /Applications/Xcode.app/Contents/Developer
configure:3036: checking for gcc
configure:3063: result: /usr/bin/cc
configure:3292: checking for C compiler version
configure:3301: /usr/bin/cc --version >&5
./configure: line 3303: /usr/bin/cc: No such file or directory
configure:3312: $? = 127
configure:3301: /usr/bin/cc -v >&5
./configure: line 3303: /usr/bin/cc: No such file or directory
configure:3312: $? = 127
configure:3301: /usr/bin/cc -V >&5
./configure: line 3303: /usr/bin/cc: No such file or directory
configure:3312: $? = 127
configure:3301: /usr/bin/cc -qversion >&5
./configure: line 3303: /usr/bin/cc: No such file or directory
configure:3312: $? = 127
configure:3332: checking whether the C compiler works
configure:3354: /usr/bin/cc conftest.c >&5
./configure: line 3356: /usr/bin/cc: No such file or directory
configure:3358: $? = 127
configure:3396: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "MacPorts"
| #define PACKAGE_TARNAME "macports"
| #define PACKAGE_VERSION "2.0.4"
| #define PACKAGE_STRING "MacPorts 2.0.4"
| #define PACKAGE_BUGREPORT "macports-dev#lists.macosforge.org"
| #define PACKAGE_URL ""
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3401: error: in `/opt/local/var/macports/sources/rsync.macports.org/release/base':
configure:3403: error: C compiler cannot create executables
See `config.log' for more details
What do I need to do? Xcode is linked to the C compiler and port knows the Xcode location.
Any help greatly appreciated.
Xcode doesn't install all the command line tools by default, and even if you've installed them in the past, you may find that they're missing after an Xcode upgrade.
In Xcode, go to Preferences -> Downloads and make sure "Command Line Tools" is installed. It's an extra 115MB download.

Resources