==> Starting prepare()...
patch: **** Can't open patch file ../../moab-5.4.0-p.1.patch : No such file or directory
Please add the patch to the source array and change ../../ to ../ as you can not assume anything about what is in the parent of $srcdir.
]]>CMAKE_INSTALL_FULL_<dir>
The absolute path generated from the corresponding CMAKE_INSTALL_<dir> value. If the value is not already an absolute path, an absolute path is constructed typically by prepending the value of the CMAKE_INSTALL_PREFIX variable. However, there are some special cases as documented below.
Those 2 lines are the only ones that use CMAKE_INSTALL_FULL and I think the first occurence on both lines is wrong.
Try applying this diff as a patch (see https://wiki.archlinux.org/title/Patching_packages if you're unfamiliar with patching)
diff --unified --recursive --text --color moab-5.3.1/CMakeLists.txt moab-5.3.1-new/CMakeLists.txt
--- moab-5.3.1/CMakeLists.txt 2021-11-12 07:17:17.000000000 +0100
+++ moab-5.3.1-new/CMakeLists.txt 2023-02-21 14:02:31.267636548 +0100
@@ -640,11 +640,11 @@
)
INSTALL(
CODE
- "file(APPEND ${CMAKE_INSTALL_FULL_LIBDIR}/moab.make MOAB_LIBDIR=${CMAKE_INSTALL_FULL_LIBDIR}\\n )"
+ "file(APPEND ${CMAKE_INSTALL_LIBDIR}/moab.make MOAB_LIBDIR=${CMAKE_INSTALL_FULL_LIBDIR}\\n )"
)
INSTALL(
CODE
- "file(APPEND ${CMAKE_INSTALL_FULL_LIBDIR}/moab.make MOAB_INCLUDES=-I${CMAKE_INSTALL_FULL_INCLUDEDIR}\\n )"
+ "file(APPEND ${CMAKE_INSTALL_LIBDIR}/moab.make MOAB_INCLUDES=-I${CMAKE_INSTALL_FULL_INCLUDEDIR}\\n )"
)
INSTALL(
FILES "${PROJECT_BINARY_DIR}/MOABConfig.cmake"
NOTES
- I have not tested this ! assuming it builds now , verify if desired functionality works.
- I know this can be done with sed, but I expect upstream will prefer a diff over a sed command in a bugreport .
Looks like lines 643 and 647 uses the `CMAKE_INSTALL_FULL_LIBDIR` variable, which I'm guessing is based on `CMAKE_INSTALL_PREFIX`. Do you know where the `CMAKE_INSTALL_FULL_LIBDIR` variable comes from? Because I don't see it defined in CMakeLists.txt.
]]> bash install.sh
python setup.py install --user
Where install.sh contains
cd /build/moab/src/build/pymoab
PYMOAB_INSTALL_PREFIX=/opt/MOAB/lib/python3.10/site-packages
export PYTHONPATH="$PYMOAB_INSTALL_PREFIX:$PYTHONPATH"
if [[ ! -d $PYMOAB_INSTALL_PREFIX ]]; then
mkdir -p /opt/MOAB/lib/python3.10/site-packages
fi
/usr/bin/python setup.py install --prefix=/opt/MOAB --record /opt/MOAB/lib/python3.10/site-packages/install_files.txt
The script looks as though it will install files directly to /opt/MOAB
Why install the python module with --user?
Have I made it executable?
]]>Other notes on the PKGBUILD: be sure to add cmake to the makedepends, and while not really a problem there is no reason for a PKGBUILD to be executable.
Note that someone versed in using cmake could likely spot the source of this issue quickly and perhaps have an easy patch to allow this to build/install properly. But sending this patch upstream would still be worthwhile, so certainly open the issue there.
]]>EDIT:
I see, I can try making an issue on the moab repo I suppose
]]>EDIT 2: the file in question is the toplevel in the build directory, and line 77 as well as line 81 include clear errors.
]]>build() {
cd $srcdir
mkdir build && cd build
cmake ../$pkgname-$pkgver -DENABLE_HDF5=ON \
-DENABLE_NETCDF=ON \
-DENABLE_FORTRAN=OFF \
-DENABLE_BLASLAPACK=OFF \
-DENABLE_PYMOAB=ON \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX=/opt
make
}
package() {
cd $srcdir/build
make DESTDIR="${pkgdir}/" install
cd pymoab
bash install.sh
python setup.py install --user
}
The /opt folder is empty, and the make DESTDIR="$pkgdir/" install command fails with:
Install the project...
-- Install configuration: ""
-- Installing: /mnt/moab/pkg/moab/opt/lib/cmake/MOAB/MOABTargets.cmake
-- Installing: /mnt/moab/pkg/moab/opt/lib/cmake/MOAB/MOABTargets-noconfig.cmake
-- Installing: /mnt/moab/pkg/moab/opt/lib/iMesh-Defs.inc
-- Installing: /mnt/moab/pkg/moab/opt/lib/moab.make
CMake Error at cmake_install.cmake:77 (file):
file failed to open for writing (No such file or directory):
/opt/lib/moab.make
make: *** [Makefile:110: install] Error 1
where ${pkgdir} is /mnt/moab/pkg/moab.
You can see that /opt/lib/moab.make exists actually at /mnt/moab/pkg/moab/opt/lib/moab.make, so I'm not sure why it's not looking there...
]]>If I try the same with MOAB, I get a permissions error.
Then tell us about this error so it can be fixed. If this is with the PKGBUILD that is currently in the AUR, the cmake PREFIX is correct, but you have not set the install DESTDIR to ${pkgdir}, rather you've tried setting it to ${pkgdir}/opt/MOAB which would not work. PREFIX is appended to DESTDIR for an install, so you've doubled up /opt/MOAB.
]]>makepkg -si
so I updated the repos, and tested with
yay -S double-down-git
which throws the following error
fatal error: moab/Core.hpp: No such file or directory
3 | #include "moab/Core.hpp"
Further up I see the following lines
-- MOAB_INCLUDE_DIRS is /home/myuser/.cache/yay/moab/pkg/moab/opt/MOAB/include/usr/include/eigen3
-- Found Embree 3.13.5 at
-- EMBREE_LIBRARY is /usr/lib/libembree3.so.3.13.5
-- EMBREE_INCLUDE_DIRS is /usr/include
The issue is definitely that the MOAB_INCLUDE_DIRS filepath does not exist, so it can't find any of the header files. I dug into this a little, and it's because when I build moab, I use ${pkgdir} in the CMAKE_INSTALL_PREFIX flag, as follows:
build() {
cd $srcdir
mkdir build && cd build
cmake ../$pkgname-$pkgver -DENABLE_HDF5=ON \
-DENABLE_NETCDF=ON \
-DENABLE_FORTRAN=OFF \
-DENABLE_BLASLAPACK=OFF \
-DENABLE_PYMOAB=ON \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX=${pkgdir}/opt/MOAB
make
}
The CMake configuration file, then uses CMAKE_INSTALL_PREFIX to set the MOAB_INCLUDE_DIRS variable, like so:
set(MOAB_LIBRARY_DIRS "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@")
see here
So, what I think is happening, is when I use ${pkgdir} in the CMAKE flag, that path actually gets built into the package for use by its upstream dependencies. The reason I'm using ${pkgdir}, is that I have read that it is best practice per the guidelines, and I get permissions errors if I don't.
Two main questions:
1.) How is embree getting away with not using ${pkgdir}? See here. If I try the same with MOAB, I get a permissions error.
2.) Is there any way I can make this work without modifying MOAB Cmake config file?
]]>