I am modifying one Makefile.am to export my headers' folder "sap_additional_headers". The issue is that no subdir of this folder is copied, while the files in this root folder are copied.
Why is that and how to solve it properly?
Related code in Makefile.am:
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(tooldir)/include/sap_additional_headers; \
for i in $(srcdir)/../include/sap_additional_headers/*.h; do \
$(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sap_additional_headers/`basename $$i`; \
done; \
$(mkinstalldirs) $(DESTDIR)$(tooldir)/include/sap_additional_headers/stl; \
for i in $(srcdir)/../include/sap_additional_headers/stl/*.h; do \
$(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sap_additional_headers/stl/`basename $$i`; \
done;
Related
I'm trying to create Dockerfile based on openjdk:8-alpine with nodejs 12.22.6-r0
After installing nodejs I'm getting this error.
Dockerfile attached below.
Thanks in advance.
~ # node
Error relocating /usr/bin/node: _ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found
Error relocating /usr/bin/node: _ZNSt19_Sp_make_shared_tag5_S_eqERKSt9type_info: symbol not found
Error relocating /usr/bin/node: _ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found
FROM openjdk:8-alpine
## install general tools
RUN apk update --no-cache && \
apk add --no-cache \
ca-certificates \
openssh-client \
libaio \
net-tools \
iputils \
perl \
bash \
sed \
zsh \
vim \
git \
make \
curl \
wget \
unzip \
jq \
procps \
ttf-dejavu \
python \
;
RUN apk add --no-cache \
--repository http://dl-cdn.alpinelinux.org/alpine/v3.11/main/ \
nodejs=12.22.6-r0 \
npm=12.22.6-r0 \
;
I'm getting this error when I run my Dockerfile.
[FATAL tini (7)] exec /docker-entrypoint.sh failed: No such file or directory
The docker build command runs fine but when I try to run it I get this issue.
I have confirmed that docker-entrypoint.sh file does exist in the root via linux find -name "docker-entrypoint.sh".
It's not a permissions issue since I have set the full read/write permissions for the file via chmod 777 command.
Any idea what I'm missing here. Below is a snippet from my Dockerfile
ARG base_image_name=tomcat
ARG base_image_version=9-jdk11-openjdk-slim
FROM $base_image_name:$base_image_version
ARG component_exe
COPY docker-entrypoint.sh $component_exe /
ENV APP_ROOT=/usr/local/tomcat
ENV component_runtime=${APP_ROOT}/webapps/$component_exe
ENV APP_USER=uat
# Install all required packages and set appropriate access permissions
RUN \
apt-get -y update && \
apt-get -y upgrade && \
apt-get install jq bash ca-certificates tini && \
adduser --disabled-password --gecos "" ${APP_USER} && \
mkdir -p ${APP_ROOT}/temp && \
mkdir -p ${APP_ROOT}/bin && \
mkdir -p ${APP_ROOT}/webapps && \
chmod 777 ${APP_ROOT}/webapps && \
chown -R ${APP_USER}:root ${APP_ROOT} && \
chmod 777 /docker-entrypoint.sh && \
chmod -R g=u ${APP_ROOT} && \
find / -name *.war && \
find / -name *tini* && \
find / -name *-entrypoint.sh && \
mv /$component_exe /usr/local/tomcat/webapps && \
chown -R :root /usr/local/openjdk-11/lib/security/cacerts && \
chmod 660 /usr/local/openjdk-11/lib/security/cacerts
EXPOSE 8080/tcp
ENTRYPOINT ["/usr/bin/tini", "--", "/docker-entrypoint.sh"]
# Start Tomcat Server.
CMD ["catalina.sh", "run"]
I am trying to create a docker image for BBMAP (https://sourceforge.net/projects/bbmap/files/latest/download) shell script suite available online along with samtools and picard.jar. I was able to run samtools and picard, but for some reason I am not able to add bbmap below. Can someone please let me know what I am missing here?
I am trying to add shell scripts to bin to run them as executables.
In my docker file below, this is where I need help:
&& wget -q https://sourceforge.net/projects/bbmap/files/latest/download \
&& tar -xjvf /tmp/download \
&& cp -av /tmp/bbmap/* /usr/bin/ \
Dockerfile:
FROM openjdk:8-jre
LABEL maintainer="AN <XXX#wustl.edu>"
LABEL org.label-schema.schema-version="1.0"
# LABEL org.label-schema.build-date=$BUILD_DATE
LABEL org.label-schema.name="an/samtofastq"
LABEL org.label-schema.description="Image for Reverting .bam"
ENV SAMTOOLS_VERSION 1.9
ENV PICARD_VERSION 2.20.8
WORKDIR /tmp
RUN apt-get update -y \
&& apt-get install --no-install-recommends -y \
make \
gcc \
g++ \
libz-dev \
libbz2-dev \
liblzma-dev \
ncurses-dev \
bc \
libnss-sss \
time \
&& cd /tmp \
&& wget -q https://github.com/samtools/samtools/releases/download/${SAMTOOLS_VERSION}/samtools-${SAMTOOLS_VERSION}.tar.bz2 \
&& tar xjvf samtools-${SAMTOOLS_VERSION}.tar.bz2 \
&& cd /tmp/samtools-${SAMTOOLS_VERSION}/ \
&& make \
&& cp -av /tmp/samtools-${SAMTOOLS_VERSION}/samtools /usr/bin/ \
&& wget -q -O /usr/bin/picard.jar https://github.com/broadinstitute/picard/releases/download/${PICARD_VERSION}/picard.jar \
&& wget -q https://sourceforge.net/projects/bbmap/files/latest/download \
&& tar -xjvf /tmp/download \
&& cp -av /tmp/bbmap/* /usr/bin/ \
&& ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime \
&& echo "America/Chicago" > /etc/timezone \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& apt-get clean all \
&& rm -rfv /var/lib/apt/lists/* /tmp/* /var/tmp/*
# COPY ./entrypoint.sh /usr/local/bin/
ENV PICARD /usr/bin/picard.jar
## Add ENV for Shell scripts from BBMAP
# ENV DEMUX /usr/bin/demuxbyname.sh
# ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["/bin/bash"]
This is the error I am getting:
tar (child): /tmp/download: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Earlier in your script, you run:
cd /tmp/samtools-${SAMTOOLS_VERSION}/
So when you run this:
wget -q https://sourceforge.net/projects/bbmap/files/latest/download
The resulting file is:
/tmp/samtools-${SAMTOOLS_VERSION}/download
That means that when you run your tar command:
tar -xjvf /tmp/download
...it doesn't find the file because it isn't in /tmp.
Either change the path on the tar command, or add a cd /tmp to your script before downloading the file. Or pass something like -O /tmp/download.tar to your wget invocation.
I have the following bash script. In the script I use rsync to copy files from a source to a destination. In the first call of rsync I copy all the files and in the second call I double-check the files and if the checksum is valid the copied files are deleted in the source.
#!/bin/bash
set -e
rsync --info=progress2 -r --include='database/session_*.db' --exclude 'database/session*' /local/data/ /import/myNas/data
rsync --info=progress2 -r --include='database/session_*.db' --exclude 'database/session*' --checksum --remove-source-files /local/data/ /import/myNas/data
The problem now is that while rsync is running new files are written to /local/data. I would like that rsync takes a snapshot of the list of files in source (/local/data) when it runs the first time and then only copies these files. In the second run rsync should then also only run on these files from the snapshot (i.e. calculate the checksum and then delete the files). That means the new added files should not be touched.
Is this possible?
Populating a null delimited list of files to synchronize before running rsync with this list:
#!/usr/bin/env bash
##### Settings #####
# Location of the source data files
declare -r SRC='/local/data/'
# Destination of the data files
declare -r DEST='/import/myNas/data/'
##### End of Settings #####
set -o errexit # same as set -e, exit if command fail
declare -- _temp_fileslist
trap 'rm -f "$_temp_fileslist"' EXIT
_temp_fileslist=$(mktemp) && typeset -r _temp_fileslist
# Populate files list as null delimited entries
find "$SRC" \
-path '*/database/session_*.db' \
-and -not -path '*/database/session*' \
-fprinf "$_temp_fileslist" '%P\0'
# --from0 tells rsync to read a null delimited list
# --files-from= tells to read the include list from this file
if rsync --info=progress2 --recursive \
--from0 "--files-from=$_temp_fileslist" -- "$SRC" "$DEST";
then rsync --info=progress2 --recursive \
--from0 "--files-from=$_temp_fileslist" \
--checksum --remove-source-files -- "$SRC" "$DEST"
fi
The original makefile I have, which works, only involves one source folder and the makefile is stored inside this folder. Now I have multiple folders inside my src folder.
I am using an autogeneration script to work out dependencies and objective files. Each subfolder has a Make-deps and Make-objs file. These are generated from the $(AUTOGEN) command
Before I had this:
deps:
$(AUTOGEN) -d -s $(SRCDIR) -f ../scripts/fgenrc ;\
sed -i "" -e's/(SRCDIR)/(OBJDIR)/' Make-objs ; \
sed -i "" -e's/(SRCDIR)\(.*\)\.o/(OBJDIR)\1\.o/g' Make-deps ; \
So $(AUTOGEN) is just the shell script which makes the dependencies and $(SRCDIR) is where the source files are. Make-obj and Make-deps are the files containing the dependencies and objective file names.
Somewhere else I have the following:
$(OBJDIR)/%.o: %.f Makefile
#$(F90) $(FFLAGS) $(POPTIONS) -o $# $<
Now I want to this but where my %.f files are in various folders, and also where I have several Make-obj and Make-deps.
Maybe I should show an example of Make-obs and Make-deps:
Make-deps:
$(OBJDIR)/fluxes.o fluxes.o: \
path/to/src/folder1/fluxes.f90 \
$(OBJDIR)/mod.o \
$(OBJDIR)/ig.o ig.o: \
path/to/src/folder1/ig.f90 \
$(OBJDIR)/mod.o \
from the sed command I change the objective file path to be $(OBJDIR) because this is where I move them when being compiled.
Make-obj
OBJS = \
$(OBJDIR)/fluxes.o \
$(OBJDIR)/ig.o \
Now I have defined
SOURCE_FILES_c := $(shell find $(SRCDIR) -name '*.c')
SOURCE_FILES_f90 := $(shell find $(SRCDIR) -name '*.f90')
which are all source files found the SRCDIR and its subfolders. Also I have defined
DEPS_FILES := $(shell find $(SRCDIR) -name 'Makefile-deps')
OBJS_FILES := $(shell find $(SRCDIR) -name 'Makefile-objs')
which are all dependency and objective files. These are found in each subfolder containing some source code.
Then, I am trying to do following. (The target deps seems to work as when I comment out the compilation rule it does create the deps and objs file correctly in each folder.)
code: create_dir deps scripts
#make -j $(CORES) $(NAMEEXE)
$(NAMEEXE): $(LIBRARY) $(OBJS)
#$(F90) $(FFLAGS) $(OPTIONS) -o $(OBJDIR)/$(MAIN).o main/$(MAIN).f90
#$(F90) -o $(NAMEEXE) $(LOPTIONS) $(OBJS) $(LIBRARY) && \
deps:
${AUTOGEN} -d $(AUTOGEN_COMMAND) -f ${AUTOCONF} ; \
$(SEDI) -e "s/[(][^)]*[)]/\$$(OBJDIR)/g" $(OBJS_FILES) ; \
$(SEDI) -e "s/[(][^)]*[)]\(.*\)\.o/\$$(OBJDIR)\1\.o/g"
$(DEPS_FILES) ; \
$(OBJDIR)/%.o: $(SOURCE_FILES_f:.f90=.o) Makefile
#$(F90) $(FFLAGS) $(POPTIONS) -o $# $< && \
( mv -f *.mod $(OBJDIR) > /dev/null 2>&1;
$(OBJDIR)/%.o: $(SOURCE_FILES_c:.c=.o) Makefile
#$(F90) $(FFLAGS) $(POPTIONS) -o $# $< && \
( mv -f *.mod $(OBJDIR) > /dev/null 2>&1;
%.o: $(SOURCE_FILES_c:.c=.o) Makefile
#make $(OBJDIR)/$#
%.o: $(SOURCE_FILES_c:.c=.f90) Makefile
#make $(OBJDIR)/$#
I am including the deps and objs by this command
-include $(DEPS_FILES)
-include $(OBJS_FILES)
I obviously did not want put the entire makefile here, but if something is missing before you can understand what's going on please let me know.
When I type make the error I get is that my $(main) source file cannot open the compiled module file which is included in the main source.
This is because it is not compiled, but this also means that my dependency file is not working as intended?
When I look into my corresponding dep file which includes the main file, I can see that the dependency modules are added to the source file