I am setting up a new TeamCity agent based on Windows Server 2012 R2 Standard. I am adding scripts to install Visual Studio 2017 build tools.
I have an issue with the building of our project:
MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\WCF\Microsoft.VisualStudio.ServiceModel.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
This is the script that I use to install the build tools:
#echo off
echo Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools
vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Workload.VCTools
echo Microsoft.VisualStudio.Workload.MSBuildTools
vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Workload.MSBuildTools
echo Microsoft.VisualStudio.Workload.NetCoreBuildTools
vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Workload.NetCoreBuildTools
echo Microsoft.VisualStudio.Workload.VCTools
vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Workload.VCTools
echo Microsoft.VisualStudio.Workload.WebBuildTools
vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Workload.WebBuildTools
Ok, figured this out. Needed to add one optional component:
echo Microsoft.VisualStudio.Wcf.BuildTools.ComponentGroup
vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Wcf.BuildTools.ComponentGroup
Related
I use Git Bash on Windows 10. When I run the following command from the TestCpp directory:
cmake -S . -B build -G "Visual Studio 15 2017" -A "Win32"
I get the following error:
CMake Error: The source directory "C:/Projects/TestCpp/build" does not exist.
When I create a build folder and then run the command from that folder:
cmake -G "Visual Studio 15 2017" -A "Win32" ..
everything works fine. Why the first command doesn't work ?
The behavior described exists when trying to use the -S and -B options with an older version of CMake that does not support them. Support for these options is documented as starting in 3.13.
I installed tf_trt_models on Jetson-nano following the instructions here. I am getting the following error
Installed /home/tarik-dev/.local/lib/python3.6/site-packages/slim-0.1-py3.6.egg
Processing dependencies for slim==0.1
Finished processing dependencies for slim==0.1
~/tf_trt_models
Installing tf_trt_models
/home/tarik-dev/tf_trt_models
running install
Checking .pth file support in /home/tarik-dev/.local/lib/python3.6/site-packages/
/home/tarik-dev/.virtualenvs/nanocv/bin/python -E -c pass
TEST FAILED: /home/tarik-dev/.local/lib/python3.6/site-packages/ does NOT support .pth files
bad install directory or PYTHONPATH
Found the solution. In the install script, because I am in virtualenv, I will need to remove --user
Here is the install.sh script
#!/bin/bash
INSTALL_PROTOC=$PWD/scripts/install_protoc.sh
MODELS_DIR=$PWD/third_party/models
PYTHON=python
if [ $# -eq 1 ]; then
PYTHON=$1
fi
echo $PYTHON
# install protoc
echo "Downloading protoc"
source $INSTALL_PROTOC
PROTOC=$PWD/data/protoc/bin/protoc
# install tensorflow models
git submodule update --init
pushd $MODELS_DIR/research
echo $PWD
echo "Installing object detection library"
echo $PROTOC
$PROTOC object_detection/protos/*.proto --python_out=.
$PYTHON setup.py install --user
popd
pushd $MODELS_DIR/research/slim
echo $PWD
echo "Installing slim library"
$PYTHON setup.py install --user
popd
echo "Installing tf_trt_models"
echo $PWD
$PYTHON setup.py install --user
I want to setup the ct-ng for my gui application and now I want to use wxwidgets.
For setting up the crosstool, I have used:
# Install prerequisites:
apt-get -y install gcc gperf bison flex gawk libtool automake libncurses5-dev texinfo
# Setup toolchain
# instructions from https://github.com/crosstool-ng/crosstool-ng
cd toolchain/crosstool-ng
./bootstrap
./configure --prefix=$HOME/.local
make && make install
echo -ne "\n\nif [ -d \"$HOME/.local/bin\" ]; then\n PATH=\"$HOME/.local/bin:$PATH\"\nfi" >> ~/.profile
source ~/.profile
mkdir ../tc/
cd ../tc/
ct-ng list-samples
ct-ng x86_64-w64-mingw32
ct-ng build # lasts 30 minutes...
##################### WxWidgets ######################
cd ../wxWidgets/
sh autogen.sh
./configure --prefix="$HOME/prefix" --enable-static --disable-shared --build=x86_64-w64-mingw32 --enable-unicode --without-libtiff --without-libjpeg --with-expat=builtin --with-libpng=builtin
make
The only way I have found is to clone wxwidgets from github and compile it as above in the script. Then, I included as path -I
WXWIDGET=../toolchain/wxWidgets/include/
$(CXX) -I$(FLEX) -I$(WXWIDGET) $(WXWIDGETSFLAGS) $(CPPFLAGS) $(header) $(src) $(obj3) -o $(OUTPUT)/$(bin)
Hundreds of errors appearing while compiling:
In file included from ../toolchain/wxWidgets/include/wx/platform.h:485:0,
from ../toolchain/wxWidgets/include/wx/defs.h:20,
from ../toolchain/wxWidgets/include/wx/string.h:24,
from ../toolchain/wxWidgets/include/wx/artprov.h:14,
from parser/include/gui.h:17,
from parser/include/customdialogs.h:17:
../toolchain/wxWidgets/include/wx/chkconf.h:282:9: error: #error "wxUSE_SECRETSTORE must be defined, please read comment near the top of this file."
# error "wxUSE_SECRETSTORE must be defined, please read comment near the top of this file."
What should I do?
You need to try "--host" and "--target" configure options.
Just try "../configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-shared --enable-unicode".
BTW, "--enable-unicode" should be turned on by default. So you can drop it.
Also, if you software required C++11, you should compile the library as:
CXXFLAGS="-std=c++11" ../configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-shared --enable-unicode
I wrote myself a litte script to install opencv under ubuntu14.04. Can I remove the directory 3party after the make install sorted the lib into system directories or are there dependencies? (Remove not only the MYBUILD but the complete 3party)
echo "\nInstall OpenCV?...<any key>\n"
read inp1; # $inp1
mkdir 3party;
cd 3party;
git clone https://github.com/Itseez/opencv.git
cd opencv;
mkdir MYBUILD;
cd MYBUILD;
#sudo mkdir -p /usr/local/lib/opencv;
cmake -L -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local .. ;
echo"check if path is ok?...<any key> or abort";
read inp1; # $inp1
make;
#sudo mkdir -p /usr/local/lib/opencv;
make install;
cd ../../..;
chmod -R 777 3party;
echo "\nDone.\nPlease exit...<any key>";
EDIT: I did tag it cmake because the configuration step is performed with this build tool. Also the tutorial on the OpenCV website stated it. Please correct me if wrong.
Building OpenCV from Source Using CMake, Using the Command Line
Normally, after installation of any package its source and binary directories can be safetly removed. OpenCV follows this convention too.
I am trying to create a deb package using cpack. But due to a bug in cpack it is creating file 'md5sums' with wrong permissions and i am getting a warning when installing the deb package using software center. I have a script which will change the permissions of the file from the deb package. But i am confused about how to automatically run the script once the package is made.
You may use post-install script like this:
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJECT_NAME}/contrib/postinst;")
I used the following method
used a script which has the following content
#!/bin/sh
set -e
mkdir fix_up_deb
dpkg-deb -x #CPACK_PACKAGE_FILE_NAME#.deb fix_up_deb
dpkg-deb --control #CPACK_PACKAGE_FILE_NAME#.deb fix_up_deb/DEBIAN
rm #CPACK_PACKAGE_FILE_NAME#.deb
chmod 0644 fix_up_deb/DEBIAN/md5sums
find -type d -print0 |xargs -0 chmod 755
fakeroot dpkg -b fix_up_deb #CPACK_PACKAGE_FILE_NAME#.deb
rm -rf fix_up_deb
Then configured it using
CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/debian/fixup_deb.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/fixup_deb.sh" #ONLY IMMEDIATE)
Then run it once the package is build using (I havnt tested this step)
add_custom_command(TARGET package POST_BUILD COMMAND bash fixup_deb.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )
Or run it manually as from the build directory
bash fixup_deb.sh