Can't run "cro stub" etc - raku

Installed Cro via Zef, but can't run "cro stub", "cro run", etc.
(Edit: Fedora 28, rakudo from Fedora)
[zv#localhost ~]$ cro stub hello
bash: cro: command not found...
[zv#localhost ~]$
So, where is "cro" installed ? Coudn't find it anywhere.
[zv#localhost ~]$ which cro
/usr/bin/which: no cro in (/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/zv/.local/bin:/home/zv/bin)
[zv#localhost ~]$ zef info cro
- Info for: cro
- Identity: Cro::Core:ver<0.7.6>
- Recommended By: /home/zv/.perl6
- Installed: Yes
Description: Implements the asynchronous pipeline at the heart of all Cro libraries.
License: Artistic-2.0
Source-url: https://github.com/croservices/cro-core.git
Provides: 19 modules
Depends: 0 items
Update: I had installed "Cro", no "cro" (all lowercase).
Following on the answer by Takao, I tried installing "cro" (all lowercase), but Zef said there was nothing more to install.
Using "--force-install" with Zef did the trick, "cro" (all lowercase) was installed in .perl6/bin.
Also, when first installing Cro there was an issue with IO::Socket::Async::SSL, which couldn't find the symbol "sk_num" in libssl.so...I told Zef to skip the test on IO::Socket::Async:SSL, and the installation suceeded. Anyway, I imagine I won't be able to use Cro with encrypted connections.

Firstly, are you sure you installed cro, not just Cro::Core module? Your zef info cro prints info for Cro::Core package it seems.
I tried to reproduce it, installing by zef install cro(note lowercase for module name).
In the end of zef's installation log I see:
1 bin/ script [cro] installed to:
/home/foo/.perl6/bin
The path above may be different(it depends on how you installed Rakudo and zef), but in general it is a path where zef stores scripts, so you need to add it to your PATH to use. You can find info about adding paths into your PATH variable, as it depends on what shell you are using.
Personally, I am using fish, so it is a matter of set PATH ~/.perl6/bin $PATH in ~/.config/fish/config.fish, but for bash or different shell it would be different.
It seems like a case of:
By accident you installed Cro(which zef thinks of Cro::Core), instead of cro(which gives you managing script you want to run). Try out zef install cro in lowercase.
You do not have path where zef installs stuff in your PATH variable. Can be fixed by adding it. Judging by your which output, it seems to be the solution you want.

Related

libwebsockets (on ubuntu) - trying compile example "lws minimal ws server + permessage-deflate echo" - can't find libwebsocketsConfig.cmake

I am an (absolute) beginner with libwebsockets (and cmake), and am trying to build one of the minimal examples from libwebsockets.org:
"lws minimal ws server + permessage-deflate echo"
at
https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/ws-server/minimal-ws-server-echo
I have installed libwebsockets-dev (sudo apt install libwebsockets-dev) and cmake (sudo apt install cmake).
The example page tells me to build the example (two .c files and CMakeLists.txt) using
$ cmake . && make
The build fails with the following message:
CMake Error at CMakeLists.txt:3 (find_package):
Could not find a package configuration file provided by "libwebsockets"
with any of the following names:
libwebsocketsConfig.cmake
libwebsockets-config.cmake
Add the installation prefix of "libwebsockets" to CMAKE_PREFIX_PATH or set
"libwebsockets_DIR" to a directory containing one of the above files. If
"libwebsockets" provides a separate development package or SDK, be sure it
has been installed.
-- Configuring incomplete, errors occurred!
See also "/home/user/ws/CMakeFiles/CMakeOutput.log".
I cannot find either of the .cmake files in my system (they are evidently not provided as part of package libwebsockets-dev.)
What am I missing?
Thank you!
Thank you, Tsyvarev, you are correct.
The solution was to build libwebsockets from github repository, use that instead of libwebsocket-dev installed from ubuntu 18.04.

screen fails on NetBSD, reporting "poll: Invalid argument"

I have installed and used screen many times on several different operating systems. Recently I installed it on a NetBSD-8.0 virtual machine.
$ sudo pkgin install screen
calculating dependencies...done.
1 package to install:
screen-4.8.0nb1
0 to refresh, 0 to upgrade, 1 to install
0B to download, 1098K to install
proceed ? [Y/n] Y
installing screen-4.8.0nb1...
screen-4.8.0nb1: setting permissions on /usr/pkg/bin/screen-4.8.0 (o=root, g=wheel, m=4511)
screen-4.8.0nb1: adding /usr/pkg/bin/screen to /etc/shells
screen-4.8.0nb1: registering info file /usr/pkg/info/screen.info
===========================================================================
$NetBSD: MESSAGE,v 1.5 2005/12/28 17:53:24 reed Exp $
[snip]
===========================================================================
pkg_install warnings: 0, errors: 0
reading local summary...
processing local summary...
marking screen-4.8.0nb1 as non auto-removable
However, when I went to use it, I got an immediate failure.
$ uname -mrs
NetBSD 8.0 amd64
$ ls -l /usr/pkg/bin/screen
lrwxr-xr-x 1 root wheel 12 Apr 6 02:50 /usr/pkg/bin/screen -> screen-4.8.0
$ groups
users wheel
$ screen
poll: Invalid argument
This problem persists even when I first remove, then reinstall the screen package. Any suggestions as to what's wrong?
My guess is that the system used to build binary packages for 8.0 (as of the 8.0_2020Q1 pkgsrc release) is no longer quite compatible with the NetBSD-8.0 release. It is likely running on a newer release, inside a chroot(8) sandbox.
I would recommend using NetBSD-9.0 instead, as that is the latest NetBSD release, or NetBSD-8.2, as that is the latest release in the netbsd-8 branch. Using the latest NetBSD and pkgsrc releases provides better coverage against unpatched vulnerabilities.
However, if you want to keep using NetBSD-8.0, you can get a working screen(1) from the 8.0_2019Q4 pkgsrc release. To have pkgin(1) pull from that release, edit the /usr/pkg/etc/pkgin/repositories.conf file to use this repository URL:
http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/8.0_2019Q4/All
There is currently likely just one line in the file that is not commented out, and it points to a URL with just 8.0 in it (which on the server is a symbolic link to the latest pkgsrc release). Just replace that line, or comment it out and add the above line.
Then remove and re-install screen:
sudo pkgin remove screen && sudo pkgin install screen

How to set up and build Apache 2.4 on WINDOWS 7 Pro?

I have a project, and need to set up and build an Apache24 server on windows, but there is almost non of information on that, can you give some advice?
I had to build and install Expat to get Apache running on windows 10 x64 with the instructions above. I build on Windows Visual Studio 2017 Community Edition using the x64 Native Command Prompt. (I installed all the VC and C++ modules - not sure which ones were specifically required.) Also i used the latest version of all of the software listed above so the install commands had to be adjusted accordingly. Trial by fire! Good luck.
I found the answer, after a lot of searching, I found an acceptable way to do it.
Software Requirements:
Visual Studio 2013 (I use the Community Edition)
Make a folder on C, call it BuildTools and install all the following programs there:
ActivePerl for Windows (64-bit, currently using 5.20.1.2000)
CMake for Windows (currently using 3.1.3)
GNU Awk for Windows (currently using 3.1.6-1)
GnuWin32 (any version from 2014+)
Netwide Assembler (NASM) (currently using 2.11.06)
Source Code Packages (I don't use ZLIB for Apache or OpenSSL, or LUA/LIBXML2/EXPAT, therefore these are not included in the process):
httpd-2.4.12.tar.gz
apr-1.5.1.tar.gz
apr-util.1.5.4.tar.gz
openssl-1.0.2a.tar.gz (yes it works with 1.0.2a!)
pcre-8.36.tar.gz
Here are the steps:
Extract all packages into their separate folders in your preferred source tree (e.g. C:\Development\Apache24\src)
Create custom build folders for Apache, PCRE, APR and APR-Util in your preferred build folder (e.g. C:\Development\Apache24\build
Your folder structure should resemble the below:
Make the following file changes so that ApacheMonitor gets built (without the Manifest error):
C:\Development\Apache24\src\httpd-2.4.12\CMakeLists.txt
Uncomment the section to build the ApacheMonitor utility (lines 769-775)
Find the following lines below, they will be in comments
# getting duplicate manifest error with ApacheMonitor
ADD_EXECUTABLE(ApacheMonitor support/win32/ApacheMonitor.c support/win32/ApacheMonitor.rc)
SET(install_targets ${install_targets} ApacheMonitor)
SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/ApacheMonitor.pdb)
SET_TARGET_PROPERTIES(ApacheMonitor PROPERTIES WIN32_EXECUTABLE TRUE)
SET_TARGET_PROPERTIES(ApacheMonitor PROPERTIES COMPILE_FLAGS "-DAPP_FILE -DLONG_NAME=ApacheMonitor -DBIN_NAME=ApacheMonitor.exe / ${EXTRA_COMPILE_FLAGS}")
TARGET_LINK_LIBRARIES(ApacheMonitor ${EXTRA_LIBS} ${HTTPD_SYSTEM_LIBS} comctl32 wtsapi32)
Also
C:\Development\Apache24\src\httpd-2.4.12\support\win32\ApacheMonitor.rc
Comment out the line that includes ApacheMonitor.manifest (line 29)
//CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "ApacheMonitor.manifest"
4.1 Create a set_path.bat file with the following code:
SET VC_HOME=c:\Program Files (x86)\Microsoft Visual Studio 13.0\VC
call VC_HOME\vcvarsall amd64
SET BUILD_ROOT=C:\BuildTools
SET PATH=%PATH%;%BUILD_ROOT%\cmake\bin
SET PATH=%PATH%;%BUILD_ROOT%\gawk\bin
SET PATH=%PATH%;%BUILD_ROOT%\nasm
SET PATH=%PATH%;%BUILD_ROOT%\perl\bin
You will need to run that file later in the process.
From the Start menu, launch the VS2013 x64 Native Tools Command Prompt found under Visual Studio 2013->Visual Studio Tools. Alternatively, but not recommended, from a Windows Command Prompt.
5.1 Go to GnuWin32, find his lib and the include folder, and copy their content to the BuildTools/perl/lib folder, this should resolve some errors that came up in the process while I was doing this
5.2 This step, you can skip now, BUT, if there is an error that includes the expat.h and the expath_external.h files, Find an older version of Apache, and copy its expat_external.h to the apache24/include folder
Find expat.h file on this site
https://github.com/apache/apr-util/blob/0.9.x/xml/expat/lib/expat.h
copy its content over the file, you find in apache24/include folder Find an older version of Apache (don't know exactly witch version), and copy its expat_external.h to the apache24/include folder
Find expat.h file on this site
https://github.com/apache/apr-util/blob/0.9.x/xml/expat/lib/expat.h
copy its content over the file, you find in apache24/include folder
5.3. Find the set_path.bat folder from the console and run it.
this you need to do, to be able to run the next steps
Navigate into the build sub-folder for PCRE, run CMAKE to generate a suitable Makefile, then compile and install
cd /D C:\Development\Apache24\build\pcre
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=C:\Apache24 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON -DPCRE_BUILD_TESTS=OFF -DPCRE_BUILD_PCRECPP=OFF -DPCRE_BUILD_PCREGREP=OFF -DPCRE_SUPPORT_PCREGREP_JIT=OFF -DPCRE_SUPPORT_UTF=ON -DPCRE_SUPPORT_UNICODE_PROPERTIES=ON -DPCRE_NEWLINE=CRLF -DINSTALL_MSVC_PDB=OFF ..\..\src\pcre-8.36
nmake
nmake install
Navigate into the source sub-folder for OpenSSL, configure the build environment for compiling with NASM, then compile and install
cd /D C:\Development\Apache24\src\openssl-1.0.2a
perl Configure VC-WIN64A --prefix=C:\Apache24 --openssldir=C:\Apache24\conf enable-camellia no-idea no-mdc2 no-ssl2 no-ssl3 no-zlib
ms\do_win64a.bat
nmake /f ms\ntdll.mak
nmake /f ms\ntdll.mak install
Navigate into the build sub-folder for APR, run CMAKE to generate a suitable Makefile, then compile and install
cd /D C:\Development\Apache24\build\apr
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=C:\Apache24 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DMIN_WINDOWS_VER=0x0600 -DAPR_HAVE_IPV6=ON -DAPR_INSTALL_PRIVATE_H=ON -DAPR_BUILD_TESTAPR=OFF -DINSTALL_PDB=OFF ..\..\src\apr-1.5.1
nmake
nmake install
Navigate into the build sub-folder for APR-Util, run CMAKE to generate a suitable Makefile, then compile and install
cd /D C:\Development\Apache24\build\apr-util
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=C:\Apache24 -DOPENSSL_ROOT_DIR=C:\Apache24 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DAPU_HAVE_CRYPTO=ON -DAPR_BUILD_TESTAPR=OFF -DINSTALL_PDB=OFF ..\..\src\apr-util-1.5.4
nmake
nmake install
Navigate into the build sub-folder for Apache, run CMAKE to generate a suitable Makefile, then compile and install
cd /D C:\Development\Apache24\build\httpd
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=C:\Apache24 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_MODULES=i -DINSTALL_PDB=OFF ..\..\src\httpd-2.4.12
nmake
nmake install
Finally, confirm everything is working
cd /D C:\Apache24\bin
openssl version
httpd -V
These are the steps and the problems I encountered, and I followed the steps from this site:
https://www.apachelounge.com/viewtopic.php?t=6462
Also I added a few more steps and solutions that I needed to do to make it work.
I hope this will help someone else in the future.

Raspberry Pi -fatal error: sys/cdefs.h: No such file or directory

I'm trying to compile gcc5.3.0 on my Raspberry Pi with latest Raspbian system image.
$ ./configure --enbale-checking=release --enable-languages=c,c++,fortran --host=arm-cortexa7_neon-linux-gnueabihf --build=arm-cortexa7_neon-linux-gnueabihf --target=arm-cortexa7_neon-linux-gnueabihf
$ make
However, the original compiler (gcc4.9) complains about not founding sys/cdefs.h when compiling libgcc.
I checked I have libc6-dev and build-essential installed.
So I used grep -R 'cdefs' /usr/include/ to search it and I found it at /usr/include/bsd/. I created the sys directory and made hard links to these headers under /usr/include/bsd/sys.
This time it gave me a more weird error,
/usr/include/stdio.h:312:8: error: unknown type name 'FILE'.
I searched this on stackoverflow, and there's a similar question, https://stackoverflow.com/a/21047237/5691005. But when I removed /usr/include/sys and /usr/include/bsd, then reinstalled libc6-dev, I cannot find sys/cdefs.h under /usr/include, and the compiler gave errors still.
I'm now totally lost. Any suggestion will be appreciated.
I had similar problem with compiling gcc-8.2. I tried to do as described here with reinstalling:
sudo apt-get --reinstall install libc6 libc6-dev
After that I was locating all missing headers:
find / -name cdefs.h
and copying them to /usr/include:
those steps allowed only to move forward but I still didn't manage to completely build gcc.
The best solution I found is to download compiled version of gcc-8.1 from:
https://solarianprogrammer.com/2017/12/07/raspberry-pi-raspbian-compiling-gcc/
I also ran into this problem when creating a containerized build environment for cross-compiled Qt applications for raspberry pi 4.
I found I needed to edit the mkspec for the linux-rasp-pi4-v3d device and add another cflag so that gcc could find the header from my Raspi sysroot that was used to cross-compile Qt.
Specifically under qtbase/mkspecs/devices/linux-rasp-pi4-v3d-g++/qmake.conf:
QMAKE_CFLAGS = -march=armv8-a -mtune=cortex-a72 -mfpu=crypto-neon-fp-armv8 -I$$[QT_SYSROOT]/usr/include/arm-linux-gnueabihf

Merging Mono Runtime 3.0.4 with MonoDevelop 3.x fails

I'm trying to merge the Mono Runtime (v 3.0.4) with a MonoMac application, but since the upgrade to 3.0.4 (from 2.10.11) this fails with the following error:
Merging Mono Runtime into app bundle
/Applications/MonoDevelop-old.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/mmp
-nolink "-minos=10.6.6"
-o "/Users/ted/Documents/XCode/Mac/StageTimer/StageTimer/bin/Release"
-n "StageTimer"
-a "/Library/Frameworks/Mono.framework/Versions/3.0.4/lib/mono/4.0/System.dll"
-a "/Library/Frameworks/Mono.framework/Versions/3.0.4/lib/mono/4.0/System.Xml.dll"
-a "/Library/Frameworks/Mono.framework/Versions/3.0.4/lib/mono/4.0/System.Core.dll"
-a "/Library/Frameworks/Mono.framework/Versions/3.0.4/lib/mono/4.0/System.Xml.Linq.dll"
-a "/Library/Frameworks/Mono.framework/Versions/3.0.4/lib/mono/4.0/System.Drawing.dll"
-a "/Applications/MonoDevelop-old.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/MonoMac.dll"
"/Users/ted/Documents/XCode/Mac/StageTimer/StageTimer/bin/Release/StageTimer.exe"
Process exited with code 1, command:
pkg-config --variable=prefix mono-2
Unhandled Exception: System.IO.DirectoryNotFoundException: Directory '/lib/mono/4.0' not found.
Even if I configure MonoDevelop to use Mono 2.10.11 instead of 3.0.4 it fails with the same error (and path: '/lib/mono/4.0'). Next I also tried modifying the symlink in /Library/Frameworks/Mono.framework/Versions/Current to point to 2.10.11 but still the same error & path.
Anyone with mono & pkg-config skills that knows how to configure this?
Similar issue happened to F# compiler when one tried to run it alongside Mono 3.0.4 (instead of 3.0.3). The issue boils down to a bugfix in Mono that prevents conflicting the homebrew pkg-config set up. The workaround that was adopted in F# sources was to hardcode the path to Mono's pkg-config.
You could probably get the same result as this by just overriding the environment variable PKG_CONFIG_PATH when launching MonoDevelop, this way:
PKG_CONFIG_PATH=/path/were/mono/pc/files/are/in/Mac:$PKG_CONFIG_PATH monodevelop
The exact path must be somewhere underneath /Library/Frameworks/Mono.framework/Versions/Current/ , just look out for files with .pc extension.