Error: cannot find a working diff3 library program - aix

While compiling rcs on AIX I got the following error:
# ./configure
creating cache ./config.cache
checking diff basename... diff
checking for diff... /usr/bin/diff
checking diff success status... 0
checking diff failure status... 1
checking diff trouble status... 2
checking diff options for RCS... -n
checking diff -L... no
checking diff3 -m... no
checking diff3 library program... configure: error: cannot find a working diff3 library program

I noticed that when I did a which diff3 the program was located here: /usr/bin/diff3.
So to fix, I changed this line in configure:
for i in /usr/*lib*/*diff3*; do
to this:
for i in /usr/*bin*/*diff3*; do
I have not fully tested, but it did compile.

Related

Building C++ Pybind11 extension with setuptools and CMake generates .so directory

I am trying to use setuptools to install a C++ library with a Pybind11 interface using CMake. For using CMake with setuptools, I am using the code in the following answer: Extending setuptools extension to use CMake in setup.py?
I am able to build the library by hand with cmake.
Unfortunately however, when executing pip install . in the root directory of my project, the build fails.
While the first call to cmake (self.spawn(['cmake', str(cwd)] + cmake_args)) finishes without any error, executing the second call (self.spawn(['cmake', '--build', '.'] + build_args)) gives me the following error:
/users/thoerman/miniconda3/envs/postproc_np_products/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot open output file /users/thoerman/postproc_np_products/build/lib.linux-x86_64-cpython-37/postproc_ops_cpp.cpython-37m-x86_64-linux-gnu.so: Is a directory
collect2: error: ld returned 1 exit status
gmake[3]: *** [/users/thoerman/postproc_np_products/build/lib.linux-x86_64-cpython-37/postproc_ops_cpp.cpython-37m-x86_64-linux-gnu.so] Error 1
gmake[2]: *** [CMakeFiles/postproc_ops_cpp.dir/all] Error 2
gmake[1]: *** [CMakeFiles/postproc_ops_cpp.dir/rule] Error 2
gmake: *** [postproc_ops_cpp] Error 2
But when running the exact same commands on the command line inside the build_temp directory, everything works just fine.
Does anyone have a hint for me, what might be going wrong?
After further digging into the problem, I found the solution myself.
The problem was with the lines
extdir = pathlib.Path(self.get_ext_fullpath(ext.name))
extdir.mkdir(parents=True, exist_ok=True)
This created a directory for the target to be built. Building the target then failed, since there was already a directory with the same name.
I was able to solve it by replacing the second line as follows:
extdir.parent.mkdir(parents=True, exist_ok=True)

Drake build from source stubgen failed

I'm building drake from source, specifically this branch of Russ' fork:
https://github.com/RussTedrake/drake
everything worked without issue until the last command make -j
where I get the following output:
[ 12%] Performing build step for 'drake_cxx_python'
INFO: Analyzed target //:install (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /Users/chewchiashaoyuan/Documents/Software/drake/bindings/pydrake/BUILD.bazel:780:22: GenerateMypyStubs bindings/pydrake/pydrake/__init__.pyi failed: (Exit 1): stubgen failed: error executing command bazel-out/darwin-opt/bin/bindings/pydrake/stubgen --quiet '--package=pydrake' '--output=bazel-out/darwin-opt/bin/bindings/pydrake'
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
Matplotlib created a temporary config/cache directory at /var/folders/sl/37m0k__51_3_5c5j02w201r40000gn/T/matplotlib-8mr5qkfg because the default path (/Users/chewchiashaoyuan/.matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.
Critical error during semantic analysis: /usr/local/lib/python3.10/site-packages/pydrake/symbolic.pyi:203: error: invalid syntax
Target //:install failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /Users/chewchiashaoyuan/Documents/Software/drake/BUILD.bazel:63:8 Middleman _middlemen/install-runfiles failed: (Exit 1): stubgen failed: error executing command bazel-out/darwin-opt/bin/bindings/pydrake/stubgen --quiet '--package=pydrake' '--output=bazel-out/darwin-opt/bin/bindings/pydrake'
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
INFO: Elapsed time: 9.617s, Critical Path: 9.33s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully
make[2]: *** [drake_cxx_python-prefix/src/drake_cxx_python-stamp/drake_cxx_python-build] Error 1
make[1]: *** [CMakeFiles/drake_cxx_python.dir/all] Error 2
make: *** [all] Error 2
My operating system is:
macOS Monterey Version 12.6
The full make -j -d output is here
I referenced https://drake.mit.edu/from_source.html, https://drake.mit.edu/bazel.html#snopt and https://github.com/RobotLocomotion/drake/issues/12175
I did the following:
git clone https://github.com/RussTedrake/drake
cd drake
git checkout kin_traj_opt2
./setup/mac/install_prereqs.sh
cd ..
mkdir drake-build
cd drake-build
cmake -DWITH_ROBOTLOCOMOTION_SNOPT=ON ../drake
make -j
Fixes attempted:
tried deleting the whole drake-build directory and doing the whole process from scratch, got the same errors
One filename from the error message stands out: /usr/local/lib/python3.10/site-packages/pydrake/symbolic.pyi. It looks like you have sudo pip install drake installed into a system-wide directory. That is likely interfering with the from-source build of Drake and will need to be removed.

Making Cmakelist (ros) failure

After installing ros(melodic version), I followed the below steps one by one.
$ mkdir -p catkin_ws/src
$ cd catkin_ws/src
$ catkin_init_workspace
$ cd ..
$ catkin_make
Then error came up like this
CMake Error at CMakeLists.txt:1:
Parse error. Expected a command name, got unquoted argument with text
"/opt/ros/melodic/share/catkin/cmake/toplevel.cmake".
-- Configuring incomplete, errors occurred!
See also "/home/hangilkim/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/hangilkim/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:320: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
I found that CMakeLists.txt file in 'home/catkin_ws/src' folder exists clearly, but contain only this message.
/opt/ros/melodic/share/catkin/cmake/toplevel.cmake
How can I solve this problem??
Looks like you are trying to compile an already compiled project. So delete the CMakeLists.txt file in 'home/catkin_ws/src' or for safety measures move it to another folder then run catkin_make command on your terminal.

Troubles with GNU Radio installation from source

I'm trying to do a clean installation on a PC running Ubuntu 16.04. Originally, GNU Radio was installed by the build-gnuradio script. However, my new USRP board had a different ABI. I decided to redo the installation. Using the script was pretty smooth the last time I used it. After a very long painful day, I got the build to go as far as 100% by issuing the command bash ./build-gnuradio -v -m. However, there is still an error as shown below
Scanning dependencies of target pyuhd
[ 99%] Building CXX object python/CMakeFiles/pyuhd.dir/pyuhd.cpp.o
[100%] Linking CXX shared library libpyuhd.so
[100%] Built target pyuhd
Scanning dependencies of target pyuhd_library
[100%] Generating build/timestamp
Traceback (most recent call last):
File "/home/kiruna/grc/uhd/host/build/python/setup.py", line 9, in <module>
from setuptools import setup
ImportError: No module named setuptools
python/CMakeFiles/pyuhd_library.dir/build.make:64: recipe for target 'python/build/timestamp' failed
make[2]: *** [python/build/timestamp] Error 1
CMakeFiles/Makefile2:3997: recipe for target 'python/CMakeFiles/pyuhd_library.dir/all' failed
make[1]: *** [python/CMakeFiles/pyuhd_library.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
UHD build apparently failed
Exiting UHD build
I have used the build-gnuradio so many times in the past but things are quite painful now. Any input will be appreciated.
I had the same problem using pybombs. It seems that the issue happens when you have both python2 and python3 installed. In that case, the cmake script in (UHDSRC)/host/python/CMakeLists.txt erroneously defaults to python3.
I have fixed the issue by replacing the mention of ${PYTHON_EXECUTABLE} around line 68 with ${PYTHON2_EXECUTABLE}
See here: https://twitter.com/f4grx/status/1143620034708815872
Not sure this change is desirable for the upstream project.

generate dsym file error

My build got this error:
GenerateDSYMFile /data/rdm/projects/14060/build/Developer/JietuMac.app.dSYM /data/rdm/projects/14060/build/Developer/JietuMac.app/Contents/MacOS/JietuMac
cd /data/rdm/projects/14060/QQ4Mac/JietuMac
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /data/rdm/projects/14060/build/Developer/JietuMac.app/Contents/MacOS/JietuMac -o /data/rdm/projects/14060/build/Developer/JietuMac.app.dSYM
/Users/rdm/Library/Developer/Xcode/DerivedData/ModuleCache/62N1HANH19UZ/Foundation-IL1BEAVQDALK.pcm: Clang modules are expected to have exactly 1 compile unit.
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil failed with exit code 1
I deleted the derivedData, then build succeed. But it needs me to delete the derivedData every time before build.
Does anybody knows how to reset the location? or solve the problem. Thanks very much.