Can anyone advise me on this ? I tried to compile using maven and got this message alongwith "Build Failure" message - maven

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (generate-core-thrift) on project accumulo-core: Command execution failed. Cannot run program "C:\Documents and Settings\deepak\trunk\core\src\main\thrift\thrift.sh" (in directory "C:\Documents and Settings\deepak\trunk\core"): CreateProcess error=193, %1 is not a valid Win32 application -> [Help 1]
I went to the directory trunk containing pom.xml and executed: mvn compile
I tried finding the plugin at http://maven.apache.org/plugins/ but couldn't find any .
Can anyone please explain what the problem is ? These open source things are so complex.

Apache Accumulo does not currently support Windows in its build system. Consider using Ubuntu, Fedora, CentOS, Mac OSX, or another Linux or BSD system. If you really must build in Windows, you my have luck with Cygwin.

It's 2022 and we can now build Apache Accumulo on Windows using Windows Subsystem for Linux.
If you want to access your Linux files from Windows, the path is:
\\wsl$\<DistroName>\home\<UserName>
Note: the above is only available when you have a WSL instance up and running.
Assuming you have a clean install of Ubuntu on WSL. Open a WSL terminal for the setup steps.
Setup
Install OpenJDK
Update list of available packages.
sudo apt update
Search for available JDKs.
apt search jdk
We will be installing JDK11 as Accumulo uses that.
sudo apt-get install openjdk-11-jdk
Check for a successful installation.
java --version
Configure JAVA_HOME
readlink -f $(which java)
Removing /bin/java from the end of the output of the above command gives us the path to the JDK.
nano ~/.bashrc
Add the following line at the bottom of the file.
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
Reflect changes.
source ~/.bashrc
Ensure the changes are in effect.
echo $JAVA_HOME
Install make and g++
sudo apt install make
sudo apt install g++
Build
Clone the repo and cd to repo root.
Now build using (from WSL terminal)
mvn package
If you are using a Windows terminal (likely when using IDEs or GUI tools) prefix wsl,
wsl mvn package

There is another description for error 193: "You may see Windows error code 193 when you are starting a Windows Share Point server or a Windows Exchange server. The error message will also generate general Service Control Manager messages in your system logs, too."
Windows error code 193
Although it doesn't have direct answer on your problem but may be it will be also helpful for you.

Related

exec: "gcc": executable file not found in %PATH% when trying go build

I am using Windows 10. When I tried to build Chaincode it reported this error
# github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11
exec: "gcc": executable file not found in %PATH%
My chaincode imports:
import (
"fmt"
"strconv"
"github.com/hyperledger/fabric/core/chaincode/shim"
pb "github.com/hyperledger/fabric/protos/peer"
)
It's running fine in Docker.
gcc (the GNU Compiler Collection) provides a C compiler. On Windows, install TDM-GCC. The github.com/miekg/pkcs11 package uses cgo. Cgo enables the creation of Go packages that call C code.
If you are running Ubuntu do:
apt-get install build-essential
This solved the problem. It installs the gcc/g++ compilers and libraries.
I also encountered this message, but in my case, it was missing gcc.exe. I used choco and installed mingw, and then it worked.
details:
download choco
choco install mingw -y
check: gcc -v
1) Install .exe from > https://sourceforge.net/projects/mingw-w64/
1.2) ! use x86_64 architecture
2) Add C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin to PATH in User Variables and in System Variables. For me it works.
! To edit Path variable press Windows key, type 'path', choose 'Edit the system environment variables', click 'Environment Variables', find Path variable in System variables and in User variables then edit.
On Windows install http://tdm-gcc.tdragon.net/download, that is all.
If you are using an alpine based image with your Dockerfile
Install build-base which will be met with your requirements.
apk add build-base
$ go env
check CGO_ENABLED if its 1 change it to 0 by
$export CGO_ENABLED=0
For my case :
os: windows 10
command:
choco install mingw
install choco if not installed:
Link: https://www.liquidweb.com/kb/how-to-install-chocolatey-on-windows/
worked for me.
The proper explanations why go build does not work for hyperledger in Windows environment are given as other answers.
For your compilation purposes, just to make it work without installing anything extra, you can try the following
go build --tags nopkcs11
It worked for me. I hope same works for you too.
You can try - this is not a solution but a temp workaround
cgo_enabled=0 go build
Once you install gcc - and make sure %PATH has a way to find it (gcc.exe) - this should go away.
Also running this one will ensure the cgo_enabled variable will stay this way as long as terminal is open. That way you don't have to prefix it each time you do a build.
export cgo_enabled=0 go build
just followed instructions from following and it solve my issue
https://code.visualstudio.com/docs/cpp/config-mingw
it ask to install Mingw-w64 via MSYS2
important command is pacman -S --needed base-devel mingw-w64-x86_64-toolchain
then add C:\msys64\mingw64\bin to PATH
thanks
For Ubuntu, what worked for me was to simply run:
sudo apt install gcc
On Amazon Linux 2:
Install go
wget https://go.dev/dl/go1.18.1.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.1.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
Install gcc
sudo yum groupinstall "Development Tools"
I recommend using the package group, even though it can be done without it, because groupinstall gives you the necessary packages to compile software on Amazon Linux and Redhat, CentOS for that matter.
on Ubuntu its very easy but on windows need to do it:
download MinGW on http://www.mingw.org/
install on basic package Gcc-g++ (see this image)
add on environment Patch of windows variables.
restart and continue with "go get ..."
If you are running Ubuntu do:
sudo apt-get update
sudo apt-get install build-essential.
If the above commands do not work do:
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe"
The main component contains applications that are free software, can be freely redistributed and are fully supported by the Ubuntu team. & The universe component is a snapshot of the free, open-source, and Linux world.
Then install package by following command in terminal:
sudo apt-get update
sudo apt-get install build-essential.
For more info click here: https://itectec.com/ubuntu/ubuntu-problem-installing-build-essential-on-14-04-1-lts-duplicate/
Just add this to your Dockerfile
RUN apk add alpine-sdk
gcc should not be necessary, unless you are cross compiling for a non-windows platform, or use cgo.
If you still need gcc, however, you should install MinGW, which provides a gcc port for Windows (Cygwin and msys should also work, although I have never actually tested this).
Edit: I see from your error message now, that it is a dependency that requires gcc. If you didn't already know this, gcc is a c/c++ compiler, and in this case it is probably needed to compile c source files included by a dependency or sub-dependency.
Instruction to fix the "exec: “gcc”: executable file not found in %PATH%" error with MSYS2:
Download MSYS2.
Put MSYS2 folder into your $PATH.
Start the MSYS2 command line program.
Run this command: pacman -S gcc.
Kindly install the MINGW after GUI will automatically take.
http://mingw.org/wiki/Getting_Started
On Windows, you can install gcc by Scoop:
scoop install gcc
you need to download MingGW64
put MingGW64 folder into your $PATH
run go build xxx.go (with cgo library)
Hi jaswanth the main problem is that you haven't register your %GO_HOME%\pkg\tool\windows_amd64 to yuour Environment Path.
%GO_HOME% is the repository where you install your go at the first time.
same as other, just install tdm-gcc, but you can use its terminal, "MinGW", you can access it from start menu folder tdm-gcc, after start, browse to your project, and run it again
I'm a Windows user and I downloaded tdm-gcc (MinGW-w64 based) from the link below:
https://jmeubank.github.io/tdm-gcc/
After installation, it made a folder named "TDM-GCC-64".
I added "C:\TDM-GCC-64\bin" to my PATH, And it fixed my problem.

SWI-Prolog Installation on RHEL 7

I am attempting to install SWI-Prolog on a server running rhel 7.
I have followed the instructions to build SWI-Prolog here: http://www.swi-prolog.org/build/Redhat.html. The build completes without error; however, I see no trace of the application.
In addition, the application does not seem accessible because I am unable to invoke swipl to begin executing Prolog commands.
I'm on Fedora 24, so probably close to your RHEL 7 situation. I never build the RPM, I simply build from sources:
git clone https://github.com/SWI-Prolog/swipl-devel
cd swipl-devel
cp build.tmpl build
<EDITOR> build <TO CUSTOMIZE>
./build
In the customization step you can set a specific directory on your system. That way you're 100% sure where it ends up.
I followed SWIPL build instructions on my CentOS 7.6.1810.
I faced two issues when configuring using cmake as per instructions
cmake ..
First, I had to install cmake3
yum install cmake3
and had to invoke it thus:
cmake3 ..
Secondly, cmake had trouble setting X11_Xpm_LIB. So I manually set the line in CMakeCache.txt
X11_Xpm_LIB:FILEPATH=/usr/lib64/libXpm.so.4
After this the config process completed successfully.
But my build is failing :(

cygwin bash not returning a valid result

I am following this :
Step 2: Installing Cygwin
Cygwin can be downloaded from http://www.cygwin.com
Run the setup file.
Install from internet. Specify C:\cygwin as the root directory.
In the Select Packages dialog box, select the packages required. gcc-core, gcc-g++, gdb, and make packages are most important. These are the C core, C++ core, the GNU Debugger and the GNU version of ‘make’ utility. These packages will be under the ‘Devel’ category.
Complete the installation.
Step 3: Testing Cygwin
To test whether Cygwin was installed properly, try the following by opening the bash shell:
cygcheck -c cygwin
gcc --version
g++ --version
make --version
gdb --version
If the version details are displayed for all these commands, the installation of Cygwin has been successful.
I got this from here
But the result I get is:
What is wrong or missing with my installation.
Follow up question:
I wanted to use the terminal window in netbeans that is why I installed this.
In this terminal widnow I also have problem. I cant type anything on it. Is this the reason for it?
Try to run /usr/bin/g++. If it is not found, then you don't have g++ installed (installation may have had problems).
You can follow the same procedure for the rest of your commands
If /usr/bin/g++ runs successfully, it means you don't have /usr/bin in your PATH (which is very unlikely). You can put that in your PATH in your startup file.

Installing serf with scons as a prerequisite for SVN 1.8.9 -> no serf binary

I am running SVN 1.8.9 on Mac OSX 10.8.5. Currently the command "svn log" fails in a given repo with the error message:
svn: E170000: Unrecognized URL scheme for 'https://...'
My research showed that this is due to SVN having been compiled from source without the flag "--with-serf".
So, I downloaded and built serf (with its dependencies APU and APR) using the scons build tool as per the instructions. All went fine, but after installation, there is no serf binary command available. When I type 'serf' in the shell, I get the command not found error. Searching for a serf binary on my machine also doesn't give any results.
What might have gone wrong during the intallation?
Where should binary be and why isn't there?
Are there any workarounds to install SVN with serf?
(I tried 'brew install --build-from-source svn', but this doesn't seem to include the serf dependency either)
Thanks a lot in advance.
Cheers,
Martin
Here is what I did:
Download latest SVN
Download the latest SCONS.
cd ~/Downloads/
tar -zxvf "latest SCONS".tar.gz
tar -zxvf "latest SVN".tar.gz
cd "latest SCONS"
python setup.py install
cd ~/Downloads/"latest SVN"
sh get-deps.sh serf
cd serf
scons install
cd ..
./configure --with-serf
make install
I got the same error here and solved by following this post:
https://ahmadawais.com/installing-svn-subversion-on-yosemite-after-removing-the-old-version/
I had to remove some old references to subversion inside:
/usr/local/include/subversion-1/
/usr/local/include/serf-1/
Building Subversion is a pain due to the dozens of dependency issues. Usually Apache httpd has to be rebuilt with Subversion too, and then there's the APR library.
The easiest solution is to download a package that has everything you need. CollabNet doesn't have a Macintosh server package, but Wandisco does. (Look for Yosemite down the Macintosh list). This will include Apache, Subversion, and the Subversion client all in one package.
I haven't used Wandisco's package before. However, I can tell you that CollabNet installs everything under /opt/collabnet including a new and complete Apache server. This also sets up /etc/init.d to start this Apache server and disables the original. I assume a similar thing happens with Wandisco (although Mac OS X doesn't use /etc/init.d, but Launch Services).
This is probably way easier than attempting to configure your Mac with everything you need for Subversion.

sudo command not found on Cygwin

I am currently trying to install and update a few packages on a Windows OS. The only matter is that I am using Cygwin in order to type the commands through a terminal (as I'm aware, I can type in Linux type commands such as cd, ls etc. on Cygwin - I may be wrong). However, when I try to install a package like:
sudo apt-get install paparazzi-dev
I get the reply:
-sh: sudo: command not found.
Does anyone have an idea as to how I can fix this problem?
Run cygwin as administrator.. then you wouldn't need any sudo command.
Cygwin is not a full Linux distribution. Therefore you don't have sudo or the Debian/Ubuntu package manager apt-get. There is a number of packages available from the Cygwin repository: http://cygwin.com/packages/
You have to chose these packages during setup.
Windows does not have sudo, apt, or almost any Linux commands to be exact. Cygwin may allow some, but as programs are not installed on Windows as packages apt-get will not work. Windows programs have installers as .exe or .msi instead.
The Windows version of sudo is called runas in case you need to run something as another user. Or, you can run Cygwin as administrator.
If you have to use the packages you need Linux. You can install it directly to replace Windows, dual-boot or use a virtualization software like VMware VirtualBox.
Making out an explanatory answer from answer here by #Aimal as it worked for me.
Cygwin may not get permissions to create folders and files when run by clicking Cygwin icon that's in normal mode.
Cygwin gets the right authorization only when right click -> "run as adminitrator" on cygwin icon because of that it gets permissions to create folders and files.
Cygwin lets you run certain commands, such as cd, ls, or mv; but it doesn't let you run other commands, such as sudo or apt-get.
If you're trying to add a package to your Cygwin installation, rerun Cygwin Setup. It may still be in your "Downloads" folder. Go through all the steps again. The Cygwin installer will automatically download and install the package you want, and add it to your Cygwin installation. (I think it will probably also upgrade all your other installed Cygwin packages to the latest available versions.)
If your desired package isn't on the Cygwin package list but is on the Cygwin Ports package list, follow the Cygwin Ports installation instructions. Note that Cygwin Ports is separate from Cygwin. Please do not send messages about Cygwin Ports packages to the cygwin.com mailing lists.
If you have years of Linux experience, you may be able to compile the software you want inside Cygwin. This can be challenging.
Perhaps an option simpler than "compile it yourself" is this: You can install VirtualBox, then install your favorite Linux distribution inside the virtual machine, then install your desired package inside Linux. (I like Ubuntu Linux, which has more than 27,000 packages in its "Universe" repository.) Now you can run Linux and Windows at the same time.
I think I tried steps below after doing some research & succeeded (on windows)
1.Install scoop using powershell 3 (iex (new-object net.webclient).downloadstring('https://get.scoop.sh'))
2. do scoop install --global sudo
3. make sure paths (C:\Users\\scoop\shims & C:\ProgramData\scoop\shims) added in environmental path variable.
In my case, I wanted to install curl, but could not create directory /usr/local/curl/lib when running command "make install", because of permission deny. so i need to change /usr/local permission. when i run sudo chmod 755 /usr/local, sudo command not found.
after searching a few solution, found that sudo is not installed by default in Cygwin. But I tried the solution that Aimal gave which is to run Cygwin as administrator. I finally can change the folder permission. Thanks Aimal.

Resources