NetBSD build failing due to .DS_Store file Macintosh - macos

I am trying to build the NetBSD kernel using
$ ./build.sh -O ../obj.amd64 -U -u -m amd64 -j4 tools release iso-image
It fails with the output
======= 1 extra files in DESTDIR =========
Files in DESTDIR but missing from flist.
File is obsolete or flist is out of date ?
------------------------------------------
./.DS_Store
========= end of 1 extra files ===========
*** [checkflist] Error code 1
nbmake[2]: stopped in /Volumes/NetBSDImage/src/distrib/sets
1 error
Even when I do an
rm .DS_Store in /Volumes/NetBSDImage/src/distrib/sets, it fails with the same message.
Earlier, when I compiled the kernel without the iso-image option, it build successfully, but now, even that fails. Some help?

The best I could come up with is a work around and not a solution.
The DS_Store files are generated only when you open them in the Finder app of Mac systems.
So, on deleting and recloning the entire repository, it built successfully.

I can crosscompile NetBSD-current fine from OS X without those files getting in the way. Did you do some manual work in destdir? Try removing the bad files then retry.

Related

Getting cmake to work under Cygwin on Windows 7

I installed the latest Cygwin on my Windows 7 machine: version 2.893 (64-bits). I made sure I included cmake, i.e. I was able to add several packages by running the Cygwin net release setup program again, after doing the first installation. I then tried to use cmake and made sure I invoked it from the bin directory:
user008#L0147816 /bin
$ ./cmake
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
//share/cmake-3.6.2
Usage
cmake [options] <path-to-source>
cmake [options] <path-to-existing-build>
Specify a source directory to (re-)generate a build system for it in the
current working directory. Specify an existing build directory to
re-generate its build system.
Run 'cmake --help' for more information.
I don't know where the build directory could be. I'm relatively new to Cygwin. I hope somebody has found a solution for getting cmake installed and working properly under Cygwin.
This looks cmake 101.
Assuming you want to just build a software download from somewhere
eg gl2ps:
# choosing a test area
$ cd /tmp
# downloading source
$ wget http://geuz.org/gl2ps/src/gl2ps-1.4.0.tgz
# expanding source code
$ tar -xf gl2ps-1.4.0.tgz
$ ls gl2ps-1.4.0-source/
CMakeLists.txt COPYING.LGPL gl2ps.h gl2ps.tex gl2psTestSimple.c
COPYING.GL2PS gl2ps.c gl2ps.pdf gl2psTest.c README.txt
# preparing a build area
$ mkdir build
$ cd build
# invoking cmake and pointing to the source directory
$ cmake ../gl2ps-1.4.0-source/
-- The C compiler identification is GNU 7.3.0
[cut ...]
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/build
# running the build
$ make
Scanning dependencies of target shared
[ 11%] Building C object CMakeFiles/shared.dir/gl2ps.o
...
[ 88%] Building C object CMakeFiles/gl2psTestSimple.dir/gl2psTestSimple.o
[100%] Linking C executable gl2psTestSimple.exe
[100%] Built target gl2psTestSimple
Instead for learning how to build with cmake, go to
https://cmake.org/cmake-tutorial/
Here a solution I just found.
Let's name 3 directories:
{cygwin64-path}/bin/: cmake.exe is here.
{cygwin64-path}/usr/share/: cmake module directory (such as cmake-3.20.0) is here.
{cygwin64-path}/share/: cmake.exe trying to find cmake-module-directory here, but it doesn't exist.
It's wired because cygwin install cmake-module-directory in {cygwin64-path}/usr/share/, but cmake.exe looks for the directory in {cygwin64-path}/share/.
So solution is simple. Each one below works.
METHOD 1: Create the directory {cygwin64-path}/share/ and copy all relevant directories and files from {cygwin64-path}/usr/share/ to the new directory.
METHOD 2: Create a Symbolic links {cygwin64-path}/share/ to {cygwin64-path}/usr/share/.
In windows 10 Administrator cmd.exe: mklink /J share usr\share and all works.
Or use WSL or Cygwin64 Terminal: ln -s usr/share share

Compiling a specific version of a freeBSD utility

I want to compile and run a specific version of a FreeBSD utility from the source code.
For example, I downloaded the repo for the following utility: https://svnweb.freebsd.org/base/stable/9/sbin/routed/
However, when I run the make command, I get the following error:
"../Makefile.inc", line 3: Cannot open ../Makefile.inc
make: fatal errors encountered -- cannot continue
*** [all] Error code 1
Can someone point me in the right direction?
You will need to download the whole source tree. The build system depends on pieces from different locations in the tree. Then;
Unpack the source in /usr/src
cd /usr/src/sbin/routed
make && make install
It looks like you want the 9-stable branch? If you have subversion available, you can do:
rm -rf /usr/src/
svn co svn://svn.freebsd.org/base/stable/9 /usr/src
(Depending on your FreeBSD version, svn may also be called svnlite) Also see the handbook.
On my machine, the complete /usr/src tree is 2445 MiB, including the .svn directory.
Edit: Note that it a program relies on system calls, library functions or other features that were introduced in a certain branch/version of FreeBSD, it will not work on older branches/versions.

Need help to build Boost from source for MinGW

I was trying to build Boost library from source for MinGW. The Boost website says no guarantee but there seem to be people done it successfully. However I couldn't find much instructions on the web.
I updated the title to better reflect my problem right now.
======================== Original post ==============================
I downloaded Boost 1.53.0, unzipped it and cd to the folder in MinGW shell. It failed at the very first step I tried:
$ ./bootstrap.sh mingw
Building Boost.Build engine with toolset gcc...
Failed to build Boost.Build build engine
Consult 'bootstrap.log' for more details
Inside the bootstrap.log the errors are:
builtins.c:33:23: fatal error: sys/wait.h: No such file or directory
compilation terminated.
execunix.c:17:26: fatal error: sys/resource.h: No such file or directory
compilation terminated.
fileunix.c:98:17: fatal error: ar.h: No such file or directory
compilation terminated.
Please help! Thanks!
================== End of original and beginning of update =====================
Update: I found this detailed instruction on line:
http://vijay.axham.com/blog/478/building-boost-binaries-on-mingw
I followed it along and now got stuck in the final build step that is supposed to take a long time but I got an error instead:
$ b2 --build-dir=$BOOST_BUILD_DIR --prefix=$BOOST_INSTALL_DIR toolset=gcc variant=release link=static threading=multi runtime-link=static install 2>&1 | tee $BOOST_BUILD_DIR/build.log
error: Unable to find file or target named
error: 'boost/tr1/tr1/bcc32'
error: referred from project at
error: '.'
but the directory is there (it should be since it's just extracted from the zip file)
$ ls boost/tr1/tr1/bcc32/
array.h random.h regex.h tuple.h type_tra.h unordere.h
Getting closer but still need help! Thanks!
OK I got it working. The trick was to download the tar.bz2 file, not the zip file from sourceforge (specifically http://sourceforge.net/projects/boost/files/boost/1.53.0/). Even though both the zip and the tar.bz2 files are listed under the same file folder for the same version of Boost, the contents are different. There are some missing folders in the zip file, and the line ending conventions of the compressed files are different. At any rate after I downloaded and extracted the tar.bz2 file. I followed the instructions given here:
http://vijay.tech/articles/wiki/Programming/Cpp/Boost/BuildingBoostOnMinGw
and successfully built the Boost library from source using MinGW shell (mintty to be exact). There were some failures but probably not important: has_icu_test, has_iconv, has_icu_obj, has_icu64_obj, .masm. At the end it says
...failed updating 2 targets...
...skipped 3 targets...
...updated 10623 targets...
Hope this will help others in the future.
Do not use bash. Build it using cmd.exe.
bootstrap.bat gcc
Compiler executable should be on PATH.
Do not use bash. Build it using cmd.exe as described below:
Install MinGw on your system. I recommend using the same bit system as your processor is. Then set the path in System Environment to the bin folder which contains g++, ... (Compiler executable should be on PATH.) files. Now you are ready to go.
For obvious reasons, start a fresh terminal (cmd.exe), don't use the already open terminals that doesn't know your new setting.
Download boost, the latest stable release, unzip it and in the command window follow the path too the main directory of the extracted boost.
Run this command: bootstrap mingw
Run this command afterwards, which will install in the folder you select as your destination.
b2 install --prefix=c:\boost\custominstallationfolder\gcc toolset=gcc
Like said above, but more specifically for me compiling boost-1.54 with gcc-mingw-4.8.1
Using a Windows shell (cmd.exe) navigate to root of boost directory directory then
bootstrap.bat gcc
b2.exe toolset=gcc

wkhtmltopdf compilation on Ubuntu

I am trying to compile wkhtmltopdf from the latest source. I am on Ubuntu 12.10 x64 server edition.
I used the instructions from here and here.
For the wkhtmltopdf-qt compilation, as mentioned by the author, the new Git repo is at gitorious.org/~antialize/qt/antializes-qt.git on the 4.8.2 branch. So, that is what I used as well.
Everything went fine. The compilation of both (qt and wkhtmltopdf) completed successfully. But I was able to use wkhtmltopdf only as root (using sudo). When I ran it as any other user, I got the following error.
error while loading shared libraries: libQtWebKit.so.4: cannot open shared object file: No such file or directory.
I had done all the compilations as root, with the files inside the root user's home directory (/root). I guessed that the wkhtmltopdf program needs to read the wkqt directory, where the compiled qt resides (and the libQtWebKit.so.4 file). This directory was inside the root user's home directory as well, thus preventing other users from running wkhtmltopdf.
So, I decided to start from scratch again. This time, I put all the source files (wkhtmltopdf-qt and wkhtmltopdf) in /usr/wkhtmltopdf. But during the compilation of qt, I get an error with the compiler trying to access qmake at the previous (old) location where qt source was present (/root/wkhtmltopdf-qt).
Error below:
ln -s libQtDeclarative.so.4.8.2 libQtDeclarative.so
ln -s libQtDeclarative.so.4.8.2 libQtDeclarative.so.4
ln -s libQtDeclarative.so.4.8.2 libQtDeclarative.so.4.8
rm -f ../../lib/libQtDeclarative.so.4.8.2
rm -f ../../lib/libQtDeclarative.so
rm -f ../../lib/libQtDeclarative.so.4
rm -f ../../lib/libQtDeclarative.so.4.8
mv -f libQtDeclarative.so.4.8.2 libQtDeclarative.so libQtDeclarative.so.4 libQtDeclarative.so.4.8 ../../lib/
make[1]: Leaving directory `/usr/wkhtmltopdf/wkhtmltopdf-qt/src/declarative'
cd src/3rdparty/webkit/Source/ && make -f Makefile.WebKit
make[1]: Entering directory `/usr/wkhtmltopdf/wkhtmltopdf-qt/src/3rdparty/webkit/Source'
/root/wkhtmltopdf-qt/bin/qmake -spec ../../../../mkspecs/linux-g++-64 -o Makefile.WebKit WebKit.pro
make[1]: /root/wkhtmltopdf-qt/bin/qmake: Command not found
make[1]: *** [Makefile.WebKit] Error 127
make[1]: Leaving directory `/usr/wkhtmltopdf/wkhtmltopdf-qt/src/3rdparty/webkit/Source'
make: *** [sub-webkit-make_default-ordered] Error 2
I don't understand how this is possible when I am starting with absolutely fresh source code.
Is there some way in which I can completely remove (uninstall) the previously installed wkhtmltopdf-qt and wkhtmltopdf?
I would appreciate some help. Thanks.
Okay, I figured it out.
Apparently, the source code was not as fresh as I thought.
I was cleaning the untracked and modified files in the Git working copy of the QT source directory. Running git status showed no modified files. But what I missed was that there were a lot of git-ignored folders and files, which still had the info about the previous compilation. These files and folders were not showing up in git status.
So, I temporarily moved the .gitignore file outside the repo and ran git clean -fd. That cleaned out all unnecessary files. Then I moved the .gitignore file back. For safety, I also ran git checkout -- . to get the latest versions of all the files from HEAD.
Compilation worked after that.

Building and using Google Protocol Buffers

I am currently working on a project, and I am trying to implement Protocol Buffers to work as a serialization format to store data on the local computer, and then be read back at a later time. Some of the features of protocol buffers seem perfect for this project so I was eager to test it out but I have run into some issues.
So far though, I have not even been able to get far enough to test out Protocol Buffers. I downloaded the most recent zip file (version 2.4.1) to my windows machine. I read through the install.txt located in the root of the folder, but it was for Unix based systems. I then saw that it came with a vsprojects folder and read through the instructions listed there. Basically, all I was told to do was open up a solution, and then build the entire solution in either Debug or Release. I instantly received several errors about "config.h" not being found.
I checked over the Unix instructions again and step one was...
cd' to the directory containing the package's source code and type
'./configure' to configure the package for your system. If you're
usingcsh' on an old version of System V, you might need to type
sh ./configure' instead to preventcsh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
So I booted into ubuntu, which I rarely use, and tried follow these instructions. The step listed above went fine and I was even able to get to the next step and 'make' the project, but then when the time came to use 'make install' I received the following errors:
ross#ubuntu:~/Desktop/protobuf-2.4.1$ make install
Making install in .
make[1]: Entering directory `/home/ross/Desktop/protobuf-2.4.1'
make[2]: Entering directory `/home/ross/Desktop/protobuf-2.4.1'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/lib/pkgconfig" || /bin/mkdir -p "/usr/local/lib/pkgconfig"
/bin/mkdir: cannot create directory `/usr/local/lib/pkgconfig': Permission denied
make[2]: *** [install-pkgconfigDATA] Error 1
make[2]: Leaving directory `/home/ross/Desktop/protobuf-2.4.1'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/ross/Desktop/protobuf-2.4.1'
make: * [install-recursive] Error 1
I primarily use windows for development, and the entire project I am working with now is being made in windows, so I am a little concerned. Has anybody had any luck building Protocol Buffers in either windows or linux?
Thank you
You can't do make install as your own user, when you're trying to install it system-wide.
Either use sudo make install if you have sudo rights, or become root any other possible way and then run it.
If you don't have admin rights, you can run ./configure --prefix=$HOME/protobuffers, compile and run make install again, it will install them in your home dir in subdir called protobuffers. Note that you might want to adjust your LD_LIBRARY_PATH in profile after that to be able to find libraries. If you only need protoc, that should do the trick.
--- edit ---
Speaking of which, protoc is also available for windows, and you can use them there as well.
You can download it here.

Resources