Install Crystal Linux Mint. Error: Could not locate compatible llvm-config - llvm

Following steps to install Crystal from source:
https://crystal-lang.org/install/from_sources/
Need to run make command that raise error:
Makefile:65: *** Could not locate compatible llvm-config, make sure it is installed and in your PATH, or set LLVM_CONFIG. Compatible versions: 12.0 11.1 11.0 10.0 9.0 8.0 7.1 6.0 5.0 4.0 3.9 3.8. Stop.
It's a known issue which can be solved this way:
heavy_check_mark from apt.llvm.org
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 11
Source: https://github.com/crystal-lang/crystal/issues/10557#issuecomment-810170295
But for Linux Mint 20:
lsb_release -a
No LSB modules are available.
Distributor ID: Linuxmint
Description: Linux Mint 20
Release: 20
Codename: ulyana
It's raises the error:
sudo ./llvm.sh 11
+ needed_binaries=(lsb_release wget add-apt-repository)
+ missing_binaries=()
+ for binary in "${needed_binaries[#]}"
+ which lsb_release
+ for binary in "${needed_binaries[#]}"
+ which wget
+ for binary in "${needed_binaries[#]}"
+ which add-apt-repository
+ [[ 0 -gt 0 ]]
+ LLVM_VERSION=13
+ '[' 1 -eq 1 ']'
+ LLVM_VERSION=11
++ lsb_release -is
+ DISTRO=Linuxmint
++ lsb_release -sr
+ VERSION=20
+ DIST_VERSION=Linuxmint_20
+ [[ 0 -ne 0 ]]
+ declare -A LLVM_VERSION_PATTERNS
+ LLVM_VERSION_PATTERNS[9]=-9
+ LLVM_VERSION_PATTERNS[10]=-10
+ LLVM_VERSION_PATTERNS[11]=-11
+ LLVM_VERSION_PATTERNS[12]=-12
+ LLVM_VERSION_PATTERNS[13]=-13
+ LLVM_VERSION_PATTERNS[14]=
+ '[' '!' _ ']'
+ LLVM_VERSION_STRING=-11
+ case "$DIST_VERSION" in
+ echo 'Distribution '\''Linuxmint'\'' in version '\''20'\'' is not supported by this script (Linuxmint_20).'
Distribution 'Linuxmint' in version '20' is not supported by this script (Linuxmint_20).
+ exit 2
Appreciate any advice to solve this issue?

According to the documentation source, it's better to use version 8.0 as the latest supported:
Even though use the proper version (8.0) is good, the script from https://apt.llvm.org/llvm.sh still raise an error:
sudo ./llvm.sh 8
+ needed_binaries=(lsb_release wget add-apt-repository)
+ missing_binaries=()
+ for binary in "${needed_binaries[#]}"
+ which lsb_release
+ for binary in "${needed_binaries[#]}"
+ which wget
+ for binary in "${needed_binaries[#]}"
+ which add-apt-repository
+ [[ 0 -gt 0 ]]
+ LLVM_VERSION=13
+ '[' 1 -eq 1 ']'
+ LLVM_VERSION=8
++ lsb_release -is
+ DISTRO=Linuxmint
++ lsb_release -sr
+ VERSION=20
+ DIST_VERSION=Linuxmint_20
+ [[ 0 -ne 0 ]]
+ declare -A LLVM_VERSION_PATTERNS
+ LLVM_VERSION_PATTERNS[9]=-9
+ LLVM_VERSION_PATTERNS[10]=-10
+ LLVM_VERSION_PATTERNS[11]=-11
+ LLVM_VERSION_PATTERNS[12]=-12
+ LLVM_VERSION_PATTERNS[13]=-13
+ LLVM_VERSION_PATTERNS[14]=
+ '[' '!' ']'
+ echo 'This script does not support LLVM version 8'
This script does not support LLVM version 8
+ exit 3
The solution is use native sudo apt-get install lldb-8 command to install the required lib.
Now make command passed:
make
Using /usr/bin/llvm-config-8 [version=8.0.1]
g++ -c -o src/llvm/ext/llvm_ext.o src/llvm/ext/llvm_ext.cc -I/usr/lib/llvm-8/include -std=c++11 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
In file included from /usr/lib/llvm-8/include/llvm/IR/DIBuilder.h:18,
from src/llvm/ext/llvm_ext.cc:1:
/usr/lib/llvm-8/include/llvm/ADT/ArrayRef.h: In instantiation of ‘llvm::ArrayRef<T>::ArrayRef(const std::initializer_list<_Tp>&) [with T = long unsigned int]’:
/usr/lib/llvm-8/include/llvm/IR/DIBuilder.h:645:74: required from here
/usr/lib/llvm-8/include/llvm/ADT/ArrayRef.h:102:37: warning: initializing ‘llvm::ArrayRef<long unsigned int>::Data’ from ‘std::initializer_list<long unsigned int>::begin’ does not extend the lifetime of the underlying array [-Winit-list-lifetime]
102 | : Data(Vec.begin() == Vec.end() ? (T*)nullptr : Vec.begin()),
CRYSTAL_CONFIG_BUILD_COMMIT="cc0b8d1f0" CRYSTAL_CONFIG_PATH='$ORIGIN/../share/crystal/src' SOURCE_DATE_EPOCH="1632497766" CRYSTAL_CONFIG_LIBRARY_PATH='$ORIGIN/../lib/crystal' ./bin/crystal build -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib

Related

nix-shell -p llvmPackages_8.stdenv doesn't have clang8 set in env

I'm trying to build a C++ project that requires a rather old version of clang, namely version 8.
That project doesn't have any default.nix or shell.nix.
I tried:
> nix-shell -p llvmPackages_8.stdenv
[nix-shell:~/git/the-project]$ clang --version
clang version 11.1.0
Target: x86_64-apple-darwin
Thread model: posix
InstalledDir: /nix/store/s759kzdnl4p740wj1965bcygwn88n4xx-clang-11.1.0/bin
As you can see the clang version is not the one I expected it to be.
I also tried
nix-shell -p llvmPackages_8.stdenv -p clang_8
nix-shell -p clangStdenv
nix-shell -p clangStdenv -p clang_8
Am I getting something wrong with nix-shell?
I found it out my self. This is how I overcame the problem. I created a shell.nix in the repo with this content:
with import <nixpkgs> {};
llvmPackages.libcxxStdenv.mkDerivation {
name = "env";
nativeBuildInputs = [ clang-tools ];
buildInputs = [ cmake openssl_1_1 python ] ++ lib.optionals libcxxStdenv.isDarwin (with darwin.apple_sdk.frameworks; [
Cocoa
CoreServices
]);
}

Can't Build Container Optimized OS | sed: -e expression #2, char 60: unknown option to `s' [duplicate]

This question already has answers here:
Using different delimiters in sed commands and range addresses
(3 answers)
Closed 1 year ago.
When following their documentation and running ./build_packages --board=lakitu, I get the following error.
Using ubuntu 16.0.4. Looks like a sed syntax error? Am I missing a variable? Does sed work differently in different operating systems or is something wrong with their documentation/scripts? Followed their documentation to the t and didn't add or configure anything. Waiting for a successful run first.
Looking at similar questions, they all appear to be syntax errors...
* Package: sys-boot/shim-14.0.20180308-r4
* Repository: lakitu
* USE: abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU
* FEATURES: network-sandbox sandbox splitdebug userpriv usersandbox
* Running stacked hooks for pre_pkg_setup
* sysroot_build_bin_dir ... [ ok ]
* Running stacked hooks for post_pkg_setup
* python_eclass_hack ... [ ok ]
* Running stacked hooks for pre_src_unpack
* python_multilib_setup ... [ ok ]
>>> Unpacking source...
>>> Unpacking shim-14.0.20180308.tar.gz to /build/lakitu/tmp/portage/sys-boot/shim-14.0.20180308-r4/work
>>> Source unpacked in /build/lakitu/tmp/portage/sys-boot/shim-14.0.20180308-r4/work
* Running stacked hooks for post_src_unpack
* asan_init ... [ ok ]
>>> Preparing source in /build/lakitu/tmp/portage/sys-boot/shim-14.0.20180308-r4/work/shim-79cdb2a215de2ace7d1bf0a294165a04b726c70a ...
>>> Source prepared.
>>> Configuring source in /build/lakitu/tmp/portage/sys-boot/shim-14.0.20180308-r4/work/shim-79cdb2a215de2ace7d1bf0a294165a04b726c70a ...
>>> Source configured.
>>> Compiling source in /build/lakitu/tmp/portage/sys-boot/shim-14.0.20180308-r4/work/shim-79cdb2a215de2ace7d1bf0a294165a04b726c70a ...
make -j8 ARCH=x86_64 CROSS_COMPILE=x86_64-cros-linux-gnu- EFI_INCLUDE=/build/lakitu//usr/include/efi EFI_PATH=/build/lakitu//usr/lib64 ARCH_LDFLAGS=--no-experimental-use-relr COMMITID=79cdb2a215de2ace7d1bf0a294165a04b726c70a DEFAULT_LOADER=\\\\grub-lakitu.efi shimx64.efi
sed -e "s,##VERSION##,14," \
-e "s,##UNAME##,Linux x86_64 Intel Xeon E312xx (Sandy Bridge, IBRS update) GenuineIntel GNU/Linux," \
-e "s,##COMMIT##,79cdb2a215de2ace7d1bf0a294165a04b726c70a," \
< /build/lakitu/tmp/portage/sys-boot/shim-14.0.20180308-r4/work/shim-79cdb2a215de2ace7d1bf0a294165a04b726c70a/version.c.in > version.c
sed: -e expression #2, char 60: unknown option to `s'
make: *** [Makefile:183: version.c] Error 1
* ERROR: sys-boot/shim-14.0.20180308-r4::lakitu failed (compile phase):
* emake failed
*
* If you need support, post the output of `emerge --info '=sys-boot/shim-14.0.20180308-r4::lakitu'`,
* the complete build log and the output of `emerge -pqv '=sys-boot/shim-14.0.20180308-r4::lakitu'`.
* The complete build log is located at '/build/lakitu/tmp/portage/logs/sys-boot:shim-14.0.20180308-r4:20190531-002217.log'.
* For convenience, a symlink to the build log is located at '/build/lakitu/tmp/portage/sys-boot/shim-14.0.20180308-r4/temp/build.log'.
* The ebuild environment file is located at '/build/lakitu/tmp/portage/sys-boot/shim-14.0.20180308-r4/temp/environment'.
* Working directory: '/build/lakitu/tmp/portage/sys-boot/shim-14.0.20180308-r4/work/shim-79cdb2a215de2ace7d1bf0a294165a04b726c70a'
* S: '/build/lakitu/tmp/portage/sys-boot/shim-14.0.20180308-r4/work/shim-79cdb2a215de2ace7d1bf0a294165a04b726c70a'
There's a , after Bridge
-e "s,##UNAME##,Linux x86_64 Intel Xeon E312xx (Sandy Bridge, IBRS update) GenuineIntel GNU/Linux," \
Change to
-e "s###UNAME###Linux x86_64 Intel Xeon E312xx (Sandy Bridge, IBRS update) GenuineIntel GNU/Linux#" \

Clang: reliably detect supported C++ standard from command line or Python

In a Python script, I am trying to determine the highest C++ standard supported by the installed Clang.
One problem is that I cannot rely on the output of clang --version to always be the same - the best example is AppleClang on OSX.
Trying to compile a hello world .cpp file with test-flags like -std=c++11, -std=c++14, ... does not seem the most robust approach and would require the creation of temporary files.
Is there any command one could run to test if a certain dialect is available without actually compiling anything?
Is there any command one could run to test if a certain dialect is available without actually compiling anything?
Yes. You can ask the compiler just to preprocess an empty file. It will do that
without complaint:
$ clang++ --version
clang version 4.0.1-6 (tags/RELEASE_401/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ echo '' | clang++ -x c++ -E -
# 1 "<stdin>"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 329 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "<stdin>" 2
$ echo $?
0
You can then incidentally add a -std option. If the compiler supports it:
$ echo '' | clang++ -std=c++98 -x c++ -E -
# 1 "<stdin>"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 326 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "<stdin>" 2
$ echo $?
0
still no complaint. But if not:
$ echo '' | clang++ -std=c++17 -x c++ -E -
error: invalid value 'c++17' in '-std=c++17'
$ echo $?
1
In a python script, you can conveniently supply an empty input file in the form of an empty string to an invocation of subprocess.run that executes the compiler probing command,
and at the same time swallows the unwanted stdout. You'd iterate such
invocations over a chronologically sorted list of -std-values to find the
latest supported. It would be prudent not simply to test the return code but
also to capture the stderr and, in case of failure, parse it for the right
sort of diagnostic, in case the command has failed for some surprise reason.
Here's a shot that serves for GCC as well as clang:
$ cat std_max.py
#!/usr/bin/python3
import subprocess
standards = ['98','03','11','14','17']
gpp_barf_pattern = "error: unrecognized command line option ‘-std=c++{0}’"
clangpp_barf_pattern = "error: invalid value 'c++{0}'"
def has_standard(compiler, std_year, barf_pattern):
std_opt = '-std=c++' + std_year
try:
subprocess.run([compiler,std_opt,'-x','c++','-E','-'],\
check=True,input=b'',stdout=subprocess.PIPE,stderr=subprocess.PIPE)
except subprocess.CalledProcessError as e:
barf = barf_pattern.format(std_year)
strerr = e.stderr.decode('utf8','strict')
if barf in strerr:
return False
raise
return True
def get_std_max(compiler,standards,barf_pattern):
max_std = standards[0] if len(standards) else ''
for std_year in standards:
if not has_standard(compiler,std_year,barf_pattern):
break
max_std = 'c++' + std_year
return max_std
which will tell me, correctly:
$ python3
Python 3.6.3 (default, Oct 3 2017, 21:45:48)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from std_max import *
>>> get_std_max('clang++',standards,clangpp_barf_pattern)
'c++14'
>>> get_std_max('g++',standards,gpp_barf_pattern)
'c++17'
>>>
No C++20 yet:
>>> has_standard('g++','20',gpp_barf_pattern)
False
>>>

How to build OpenSSL on Windows with Visual Studio 2017?

I am trying to use OpenSSL but I am stuck on the step of compiling. The OpenSSL project has very unfriendly (bad) documentation.
Is there any actual help how to build the latest OpenSSL version on Windows with Visual Studio 2017?
I didn't find any helpful information on the official OpenSSL site. Yes, there are a lot of posts on the Internet about OpenSSL compilation, but all of them are obsolete.
I've not used VS2017 but previous versions. I imagine it is much the same. Note the instructions below are for OpenSSL 1.1.0 or above. They do not work for OpenSSL 1.0.2. In brief the steps are:
Install Perl (either ActiveState or Strawberry)
[EDIT, see my (kritzel_sw) comment below: I would strongly recommend to use Strawberry)]
Install NASM
Make sure both Perl and NASM are on your %PATH%
Fire up a Visual Studio Developer Command Prompt with administrative privileges (make sure you use the 32-bit one if you are building 32-bit OpenSSL, or the 64-bit one if you are building 64-bit OpenSSL)
From the root of the OpenSSL source directory enter perl Configure VC-WIN32, if you want 32-bit OpenSSL or perl Configure VC-WIN64A if you want 64-bit OpenSSL
Enter nmake
Enter nmake test
Enter nmake install
[EDIT, unless you change the target directory in the configuration, nmake install needs administrator privileges. So the VC command prompt must be started as administrator for this final step]
If anything goes wrong at any stage, check the INSTALL file and the NOTES.WIN file.
Modified version of The Quantum Physicist python script
It can compile OpenSSL 1.0.x or OpenSSL 1.1.x
It can compile with multiple version of Visual Studio 2017/2019 included.
1) Create the file: CompileOpenSSL.py
import os
import os.path
from subprocess import call
import shutil
import sys
import re
import argparse
# args
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--filename", help="First argument must be the tar.gz file of OpenSSL source", required=True)
parser.add_argument("-a", "--arch", help="Second argument must be x86 or amd64", required=True)
parser.add_argument("-v", "--vs_version", help="Visual Studio version (eg:90, 140, 150)", required=True)
parser.set_defaults(writeVersionInfos=False)
args = parser.parse_args()
compile_flags = "-no-asm"
#compile_flags = "-no-asm -no-shared"
openssl_32_flag = "VC-WIN32"
openssl_64_flag = "VC-WIN64A"
working_dir = os.getcwd()
dirname = args.filename.replace(".tar.gz","")
src_32_suffix = "_" + "vs" + args.vs_version + "_32"
src_64_suffix = "_" + "vs" + args.vs_version + "_64"
vs_tools_env_var = "VS" + args.vs_version + "COMNTOOLS"
if args.arch != "x86" and args.arch != "amd64":
print("Second argument must be x86 or amd64")
exit(1)
if not bool(re.match("(openssl-){1}(\d)+(.)(\d)+(.)(\d)+(\w)+(.tar.gz)",args.filename)):
print("The file given doesn't seem to be an openssl source file. It must be in the form: openssl-x.y.zw.tar.gz")
exit(1)
call("7z x -y " + args.filename) #extract the .gz file
dirname_src_32 = dirname + src_32_suffix
dirname_src_64 = dirname + src_64_suffix
dirname_bin_32 = dirname + src_32_suffix + "_build"
dirname_bin_64 = dirname + src_64_suffix + "_build"
openssl_tar_file = args.filename[0:-3]
if args.arch == "x86":
#delete previous directories
shutil.rmtree(os.getcwd()+'/'+dirname, ignore_errors=True)
shutil.rmtree(os.getcwd()+'/'+dirname_src_32, ignore_errors=True)
#extract tar file for 32
call("7z x -y " + openssl_tar_file)
os.rename(dirname, dirname_src_32)
#Compile 32
os.chdir(dirname_src_32)
print("perl Configure " + openssl_32_flag + " --prefix=" + os.path.join(working_dir,dirname_bin_32) + " " + compile_flags)
call("perl Configure " + openssl_32_flag + " --prefix=" + os.path.join(working_dir,dirname_bin_32) + " " + compile_flags,shell=True)
if( os.path.exists("ms/do_ms.bat") ):
call("ms\do_ms.bat",shell=True)
print(os.getcwd())
call("nmake -f ms/ntdll.mak",shell=True)
call("nmake -f ms/ntdll.mak install",shell=True)
else:
call("nmake",shell=True)
call("nmake test",shell=True)
call("nmake install",shell=True)
print("32-bit compilation complete.")
#Go back to base dir
os.chdir(working_dir)
################
if args.arch == "amd64":
#delete previous directories
shutil.rmtree(os.getcwd()+'/'+dirname, ignore_errors=True)
shutil.rmtree(os.getcwd()+'/'+dirname_src_64, ignore_errors=True)
#extract for 64
call("7z x -y " + openssl_tar_file)
os.rename(dirname, dirname_src_64)
#Compile 64
os.chdir(dirname_src_64)
call("perl Configure " + openssl_64_flag + " --prefix=" + os.path.join(working_dir,dirname_bin_64) + " " + compile_flags,shell=True)
if( os.path.exists("ms\do_ms.bat") ):
call("ms\do_win64a.bat",shell=True)
call("nmake -f ms/ntdll.mak",shell=True)
call("nmake -f ms/ntdll.mak install",shell=True)
else:
call("nmake",shell=True)
call("nmake test",shell=True)
call("nmake install",shell=True)
print("64-bit compilation complete.")
#Go back to base dir
os.chdir(working_dir)
################
os.remove(openssl_tar_file)
2) Create the file: CompileOpenSSL_vs.cmd
ECHO --------------------------------------
ECHO Require Python, 7Zip, PERL and NASM in PATH
ECHO --------------------------------------
Rem ------------------------------------------------------
Rem TO CONFIGURE -----------------------------------------
Rem ------------------------------------------------------
Rem SET YOUR LOCAL PATHS-----------------------------------------
SET PATH=C:\Program Files (x86)\7-Zip;C:\Perl64\bin;M:\Backup\Coders\_tools\7-Zip\;%PATH%
Rem SET YOUR OPENSSL ARCHIVE-----------------------------------------
REM SET FILENAME=openssl-1.0.2r.tar.gz
SET FILENAME=openssl-1.1.1b.tar.gz
Rem SET THE VERSION OF YOUR VISUAL STUDIO-----------------------------------------
SET VSVERSION=%1
Rem ------------------------------------------------------
Rem COMPILATION LAUNCH -----------------------------------
Rem ------------------------------------------------------
Rem UTILS PATH-----
SET VSCOMNTOOLSNAME=VS%VSVERSION%COMNTOOLS
Rem Pick the good path for Visual Studio-----------------------------------------
IF %VSVERSION% GEQ 150 (
Echo DO NOT FORGET TO ADD A SYSTEM VARIABLE %VSCOMNTOOLSNAME% - like: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\"
SET VCVARPATH="%%%VSCOMNTOOLSNAME%%%..\..\VC\Auxiliary\Build\vcvarsall.bat"
) ELSE (
SET VCVARPATH="%%%VSCOMNTOOLSNAME%%%..\..\VC\vcvarsall.bat"
)
Rem Set env -----------------------------------------
#pushd "%~dp0"
call %VCVARPATH% %2
#popd
Rem ------------------------------------------------------
Rem TEST APP EXIST -----------------------------------
Rem ------------------------------------------------------
where /q 7z.exe
IF ERRORLEVEL 1 (
ECHO The application "7z.exe" is missing. Ensure to add/install it to the PATH in beginning of this script, check SET PATH
PAUSE
EXIT /B
)
where /q perl.exe
IF ERRORLEVEL 1 (
ECHO The application "perl.exe" is missing. Ensure to add/install it to the PATH in beginning of this script, check SET PATH
PAUSE
EXIT /B
)
where /q nmake.exe
IF ERRORLEVEL 1 (
ECHO The application "nmake.exe" is missing. Ensure to add/install it to the PATH in beginning of this script, check SET PATH
PAUSE
EXIT /B
)
where /q py.exe
IF ERRORLEVEL 1 (
ECHO The application "py.exe" [shortcut of python] is missing. Ensure to add/install it to the PATH in beginning of this script, check SET PATH
PAUSE
EXIT /B
)
Rem Launch compilation -----------------------------------------
py CompileOpenSSL.py -f %FILENAME% -a %2 -v %VSVERSION%
PAUSE
3) Launch compilation from command line (Outside Visual Studio)
eg:
CompileOpenSSL_vs.cmd 150 x86
CompileOpenSSL_vs.cmd 150 amd64
CompileOpenSSL_vs.cmd 90 x86
For OpenSSL 1.0.2, I wrote a Python script that does the building for me. I have this habit of making these scripts, as I don't like to reinvent the wheel everytime I need to build something.
The script is made for OpenSSL 1.0.2. Probably the changes are minimal for OpenSSL 1.1.0.
Here's the script:
import os
from subprocess import call
import sys
import re
vs_version = "140"
compile_flags = "-no-asm -no-shared"
openssl_32_flag = "VC-WIN32"
openssl_64_flag = "VC-WIN64A"
src_32_suffix = "_" + "vs" + vs_version + "_32"
src_64_suffix = "_" + "vs" + vs_version + "_64"
vs_tools_env_var = "VS" + vs_version + "COMNTOOLS"
if len(sys.argv) < 2:
print("First argument must be the tar.gz file of OpenSSL source")
exit(1)
if len(sys.argv) < 3:
print("Second argument must be 32 or 64")
exit(1)
filename = sys.argv[1]
dirname = filename.replace(".tar.gz","")
working_dir = os.getcwd()
arch = sys.argv[2]
if arch != "32" and arch != "64":
print("Second argument must be 32 or 64")
exit(1)
if not bool(re.match("(openssl-){1}(\d)+(.)(\d)+(.)(\d)+(\w)+(.tar.gz)",filename)):
print("The file given doesn't seem to be an openssl source file. It must be in the form: openssl-x.y.zw.tar.gz")
exit(1)
call("7z x " + filename) #extract the .gz file
dirname_src_32 = dirname + src_32_suffix
dirname_src_64 = dirname + src_64_suffix
dirname_bin_32 = dirname + src_32_suffix + "_build"
dirname_bin_64 = dirname + src_64_suffix + "_build"
openssl_tar_file = filename[0:-3]
if arch == "32":
#extract tar file for 32
call("7z x " + openssl_tar_file)
os.rename(dirname, dirname_src_32)
#Compile 32
os.chdir(dirname_src_32)
call("perl Configure " + openssl_32_flag + " --prefix=" + os.path.join(working_dir,dirname_bin_32) + " " + compile_flags,shell=True)
call(r"ms\do_ms.bat",shell=True)
call(r"nmake -f ms\nt.mak",shell=True)
call(r"nmake -f ms\nt.mak instalL",shell=True)
print("32-bit compilation complete.")
#Go back to base dir
os.chdir(working_dir)
################
if arch == "64":
#extract for 64
call("7z x " + openssl_tar_file)
os.rename(dirname, dirname_src_64)
#Compile 64
os.chdir(dirname_src_64)
call("perl Configure " + openssl_64_flag + " --prefix=" + os.path.join(working_dir,dirname_bin_64) + " " + compile_flags,shell=True)
call(r"ms\do_ms.bat",shell=True)
call(r"nmake -f ms\nt.mak",shell=True)
call(r"nmake -f ms\nt.mak instalL",shell=True)
print("64-bit compilation complete.")
#Go back to base dir
os.chdir(working_dir)
################
os.remove(openssl_tar_file)
Option 1: Save the script to CompileOpenSSL.py, and download the OpenSSL source file that is expected to have the name format openssl-1.X.Y.tar.gz. Now assuming that 7zip and perl are accessible from the global scope on your command prompt and you have the correct MSVC variables loaded (with e.g. vsvars32.bat, or starting the right terminal), run the following:
python CompileOpenSSL.py openssl-1.X.Y.tar.gz 32
If you're using MSVC 32-bit, or
python CompileOpenSSL.py openssl-1.X.Y.tar.gz 64
for MSVC 64-bit.
Option 2: Do what the script does manually. The script simply extracts the archive, configures the sources and runs do_ms.bat then nmake. Follow the source and it'll work.
Good luck!
go into ssl directory using visual studio cmd and add perl and nasm to system path then type:
perl Configure --openssldir=D:OpenSSLdirectory VC-WIN32
ms\do_ms.bat
nmake -f ms\ntdll.mak
nmake -f ms\ntdll.mak install
( enjoy. )

/etc/init.d/celeryd start fail on AWS

Hi I've been reading a lot about this on this forums but I just don't have an idea of what's going wrong right now, looks like everything is ok, but just don't work
I set up my local configuration like this (/etc/default/celeryd):
# or we could have three nodes:
#CELERYD_NODES="w1 w2 w3"
# Absolute or relative path to the 'celery' command:
#CELERY_BIN="/usr/local/bin/celery"
CELERY_BIN="/home/ubuntu/.virtualenvs/wlenv/bin/celery"
# Where to chdir at start.
CELERYD_CHDIR="/var/www/DIR_TO_MANAGE.PY_FOLDER"
# Python interpreter from environment.
ENV_PYTHON="/home/ubuntu/.virtualenvs/wlenv/bin/python"
#ENV_PYTHON="/usr/bin/python2.7"
# Name of the projects settings module.
export DJANGO_SETTINGS_MODULE="sec.settings"
# How to call "manage.py celeryd_multi"
CELERYD_MULTI="$CELERYD_CHDIR/manage.py celeryd_multi"
# Extra arguments to celeryd
CELERYD_OPTS="--time-limit 300 --concurrency=8"
# Name of the celery config module.
CELERY_CONFIG_MODULE="celeryconfig"
# %n will be replaced with the nodename.
CELERYD_LOG_FILE="/logs/celery/log/%n.log"
CELERYD_PID_FILE="/logs/celery/run/%n.pid"
# Workers should run as an unprivileged user.
CELERYD_USER="ubuntu"
CELERYD_GROUP="ubuntu"
# If enabled pid and log directories will be created if missing,
# and owned by the userid/group configured.
CELERY_CREATE_DIRS=1
When I run /etc/init.d/celeryd start I get this:
celeryd-multi v3.0.9 (Chiastic Slide)
> Starting nodes...
> celery.ip-10-51-179-42: OK
> 300.ip-10-51-179-42: OK
But the workers are not running (/etc/init.d/celeryd status):
Error: No nodes replied within time constraint.
I read something about run like this (sh -x /etc/init.d/celeryd start) and find the error, most of the time is a file permissions error but I don't see nothing wrong
+ DEFAULT_PID_FILE=/logs/celery/run/celeryd#%n.pid
+ DEFAULT_LOG_FILE=/logs/celery/log/celeryd#%n.log
+ DEFAULT_LOG_LEVEL=INFO
+ DEFAULT_NODES=celery
+ DEFAULT_CELERYD=-m celery.bin.celeryd_detach
+ CELERY_DEFAULTS=/etc/default/celeryd
+ test -f /etc/default/celeryd
+ . /etc/default/celeryd
+ CELERY_BIN=/home/ubuntu/.virtualenvs/wlenv/bin/celery
+ CELERYD_CHDIR=/var/www/DIR_TO_MANAGE.PY_FOLDER
+ ENV_PYTHON=/home/ubuntu/.virtualenvs/wlenv/bin/python
+ export DJANGO_SETTINGS_MODULE=sec.settings
+ CELERYD_MULTI=/var/www/DIR_TO_MANAGE.PY_FOLDER/manage.py celeryd_multi
+ CELERYD_OPTS=--time-limit 300 --concurrency=8
+ CELERY_CONFIG_MODULE=celeryconfig
+ CELERYD_LOG_FILE=/logs/celery/log/%n.log
+ CELERYD_PID_FILE=/logs/celery/run/%n.pid
+ CELERYD_USER=ubuntu
+ CELERYD_GROUP=ubuntu
+ CELERY_CREATE_DIRS=1
+ [ -f /etc/default/celeryd ]
+ . /etc/default/celeryd
+ CELERY_BIN=/home/ubuntu/.virtualenvs/wlenv/bin/celery
+ CELERYD_CHDIR=/var/www/DIR_TO_MANAGE.PY_FOLDER
+ ENV_PYTHON=/home/ubuntu/.virtualenvs/wlenv/bin/python
+ export DJANGO_SETTINGS_MODULE=sec.settings
+ CELERYD_MULTI=/var/www/DIR_TO_MANAGE.PY_FOLDER/manage.py celeryd_multi
+ CELERYD_OPTS=--time-limit 300 --concurrency=8
+ CELERY_CONFIG_MODULE=celeryconfig
+ CELERYD_LOG_FILE=/logs/celery/log/%n.log
+ CELERYD_PID_FILE=/logs/celery/run/%n.pid
+ CELERYD_USER=ubuntu
+ CELERYD_GROUP=ubuntu
+ CELERY_CREATE_DIRS=1
+ CELERYD_PID_FILE=/logs/celery/run/%n.pid
+ CELERYD_LOG_FILE=/logs/celery/log/%n.log
+ CELERYD_LOG_LEVEL=INFO
+ CELERYD_MULTI=/var/www/DIR_TO_MANAGE.PY_FOLDER/manage.py celeryd_multi
+ CELERYD=-m celery.bin.celeryd_detach
+ CELERYCTL=celeryctl
+ CELERYD_NODES=celery
+ export CELERY_LOADER
+ [ -n ]
+ dirname /logs/celery/log/%n.log
+ CELERYD_LOG_DIR=/logs/celery/log
+ dirname /logs/celery/run/%n.pid
+ CELERYD_PID_DIR=/logs/celery/run
+ [ ! -d /logs/celery/log ]
+ [ ! -d /logs/celery/run ]
+ [ -n ubuntu ]
+ DAEMON_OPTS= --uid=ubuntu
+ chown ubuntu /logs/celery/log /logs/celery/run
+ [ -n ubuntu ]
+ DAEMON_OPTS= --uid=ubuntu --gid=ubuntu
+ chgrp ubuntu /logs/celery/log /logs/celery/run
+ [ -n /var/www/DIR_TO_MANAGE.PY_FOLDER/contracts ]
+ DAEMON_OPTS= --uid=ubuntu --gid=ubuntu --workdir="/var/www/DIR_TO_MANAGE.PY_FOLDER/contracts"
+ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/sbin:/sbin
+ check_dev_null
+ [ ! -c /dev/null ]
+ check_paths
+ dirname /logs/celery/run/%n.pid
+ ensure_dir /logs/celery/run
+ [ -d /logs/celery/run ]
+ mkdir -p /logs/celery/run
+ chown ubuntu:ubuntu /logs/celery/run
+ chmod 02755 /logs/celery/run
+ dirname /logs/celery/log/%n.log
+ ensure_dir /logs/celery/log
+ [ -d /logs/celery/log ]
+ mkdir -p /logs/celery/log
+ chown ubuntu:ubuntu /logs/celery/log
+ chmod 02755 /logs/celery/log
+ start_workers
+ /var/www/DIR_TO_MANAGE.PY_FOLDER/manage.py celeryd_multi start celery --uid=ubuntu --gid=ubuntu --workdir="/var/www/DIR_TO_MANAGE.PY_FOLDER" --pidfile=/logs/celery/run/%n.pid --logfile=/logs/celery/log/%n.log --loglevel=INFO --cmd=-m celery.bin.celeryd_detach --time-limit 300 --concurrency=8
celeryd-multi v3.0.9 (Chiastic Slide)
> Starting nodes...
> celery.ip-10-51-179-42: OK
> 300.ip-10-51-179-42: OK
+ exit 0
Any ideas?
Which version of celery are you using?
When you debugged you used "C_FAKEFORK=1 sh -x /etc/init.d/celeryd start" (with C_FAKEFORK=1) right?
If you are using the version 3.x+ you dont need to use "manage.py celery" (djangp-celery) instead you have to use the "celery" command which come with celery itself.
Take a look to this part of the doc documentation.
Thanks!