stdint.h not found on first compile under FreeBSD

38 views
Skip to first unread message

Allan Stokes

unread,
Mar 19, 2020, 6:07:17 AM3/19/20
to Zotonic developers
Hello, everyone.

This is my first foray into actually running Zotonic, though I did quite a bit of reading about Zotonic a couple of years back when I first experimented with Elixir. Managed to write some simple programs despite being new to Erlang altogether, and I quite liked it, but my pretext for this coding adventure vanished under me, and it has since taken me a couple of years to concoct a new pretext.

I switched myself over to FreeBSD (or various close derivatives) several years ago because I liked ZFS snapshots a lot.

For my first Zotonic install, I'm installing onto my FreeBSD 12 workstation plain vanilla, without adding the complexity of a jail (or iocage).

I got the Erlang and Postgres dependencies installed easily enough.

And the git clone worked.

When I run plain make, it doesn't find CC.

So I ran make CC=gcc9 and I get an error over stdint.h not found.

So I ran make CC=clang80 and the same thing.

/usr/home/allan/work/zotonic/zotonic/c_src/syslog_drv.c:24:10: fatal error: 'stdint.h' file not found 

Google did not resolve this for me right away. Found some very outdated forum posts about FreeBSD having stdint.h in a slightly nonstandard place ("nonstandard" by the non-standard of how Linux does it, anyway).

But also I'm lacking the dependency build-essential, which I'm not sure is actually essential under FreeBSD.

So the diagnostic tree is getting a bit bushy to merely grope around, and I thought I would instead introduce myself at this early juncture, and ask for guidance.

If my local experimentation is fruitful, I might be back again soon for some guidance on suitable cloud hosts.

What I'm trying to pull together is basically a blog with some data and some models, where the blog has a thematic bias toward robustness and systems theory, which I would ideally dogfood in the platform itself.

Robustness: ZFS, Postgres, Beam VM. Three of my favourite things. (Weirdly, I watched hours of video about beam and the OTP before pulling out my code editor, because that's how I roll. The robustness code-smell was overwhelming. So I knew it was my favourite thing, even before I found a good excuse to really use it.)

Any ideas on my stdint.h problem?

[*] Today's trivia: Microsoft originally popularized the term "eating your own dogfood" during the development of Windows NT, when Dave Cutler insisted that the coding of the OS be performed under the current builds.

I found that on Coding Horror, but I remember it well myself, the era in which "to dogfood" was first verbed in the English language, and I've never fully recovered from the culture of anti-quality which paradoxically ensued.

What Spock really said (in Vulcan): long uptime and short latency on fat queues. But it was slightly mangled in translation as "live long and prosper".

TIA,
Allan

Nikolas Nikou

unread,
Mar 19, 2020, 7:29:16 AM3/19/20
to zotonic-d...@googlegroups.com
Hi

FreeBSD has erlang in pkgs
I have deployed both postgres and erlang/zotonic in its owns jails using iocage.

iocage create -b -r 12.1-RELEASE --name jail-erlang boot=on jail_zfs=on ip4_addr="em0|10.1.1.11/24" defaultrouter="10.1.1.1" notes="jail for erlang" 


iocage create -b -r 12.1-RELEASE --name jail-postgres boot=on jail_zfs=on ip4_addr="em0|10.1.1.12/24" defaultrouter="10.1.1.1" allow_sysvipc=1 sysvmsg=new sysvsem=new  sysvshm=new notes="jail for postgreSQL"


to install erlang in jail
iocage start jail-erlang
iocage console jail-erlang
pkg install erlang-runtime22

you should be asked first to install/update pkg within the jail
pkg search erlang you will see all available packages/versions

in zotonic you must use IPv4 and need to set the ip in the configuration otherwise zotonic crashes.

Best Regards
Nikolas

--

---
You received this message because you are subscribed to the Google Groups "Zotonic developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotonic-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zotonic-developers/751e76f6-ee14-4e19-9d74-176f0c3010e6%40googlegroups.com.

Marc Worrell

unread,
Mar 19, 2020, 7:44:14 AM3/19/20
to 'Marc Worrell' via Zotonic developers
Hi Nikolas,

> On 19 Mar 2020, at 12:29, Nikolas Nikou <niko...@telehorizon.com> wrote:
>
> in zotonic you must use IPv4 and need to set the ip in the configuration otherwise zotonic crashes.

Interesting, how & where do we crash on IPv6 addresses?

Maybe there is a difference between Linux and BSD here.

- Marc

M-MZ

unread,
Mar 19, 2020, 8:02:21 AM3/19/20
to Zotonic developers
I have to look into that. We normally build on linux and macos, but it should definitely work in freebsd as well.

Could you check if this works?


Adapt the rebar.config to this:

%% -*- mode: erlang;erlang-indent-level: 2;indent-tabs-mode: nil -*-
%% -*- coding: utf-8 -*-

{erl_opts, [
 debug_info,
 warnings_as_errors,
 warn_untyped_record,
 {platform_define, "^[0-9]+", namespaced_types}
]}.

{plugins, [pc]}.

{artifacts, ["priv/syslog_drv.so"]}.

{provider_hooks, [
  {post,
     [
       {compile, {pc, compile}},
       {clean, {pc, clean}}
     ]
}]}.

And run rebar3 compile?

I'm wondering if your problem is fixed by using the standard port compiler.

Regards,

Maas

Allan Stokes

unread,
Mar 19, 2020, 1:14:48 PM3/19/20
to Zotonic developers

FreeBSD has erlang in pkgs
I have deployed both postgres and erlang/zotonic in its owns jails using iocage.
 
This is fabulously useful, but my present problem was compiling Zotonic itself.

Will my Zotonic compilation problem magically resolve itself within the jail environment? That's not usually been my experience.

in zotonic you must use IPv4 and need to set the ip in the configuration otherwise zotonic crashes.
 
Also noted.

I will start a parallel initiative on these instructions, but I'd be left scratching my head to not run into my stdint.h problem for a second time.

Allan Stokes

unread,
Mar 19, 2020, 1:16:29 PM3/19/20
to Zotonic developers

Could you check if this works?


Adapt the rebar.config to this:

%% -*- mode: erlang;erlang-indent-level: 2;indent-tabs-mode: nil -*-
%% -*- coding: utf-8 -*- 

Sorry, I didn't scan down the thread before my first reply.

Yes, I can definitely check this modification.

Java House

unread,
Mar 19, 2020, 2:07:52 PM3/19/20
to zotonic-d...@googlegroups.com
Hi

I followed the instrunctions from here

# pkg install sudo zip wget bash gmake curl git gcc curl
# pkg install ImageMagick7-nox11 
# pkg install erlang-runtime22  

you will need also to update your path for erlang.
I updated .profile by adding this line
PATH=$PATH:/usr/local/lib/erlang22/bin; export PATH

I built with gmake not make
$ cd zotonic
$ gmake
$ bin/zotonic debug

here are all my packages in the jail
root@jail-erlang:~ # pkg info 
ImageMagick7-nox11-7.0.8.57_1  Image processing tools
apr-1.7.0.1.6.1                Apache Portability Library
avahi-app-0.7_2                Service discovery on a local network
bash-5.0.11                    GNU Project's Bourne Again SHell
binutils-2.33.1,1              GNU binary tools
ca_root_nss-3.50               Root certificate bundle from the Mozilla Project
cups-2.2.12                    Common UNIX Printing System
curl-7.67.0                    Command line tool and library for transferring data with URLs
cvsps-2.1_2                    Create patchset information from CVS
db5-5.3.28_7                   Oracle Berkeley DB, revision 5.3
dbus-1.12.16                   Message bus system for inter-application communication
dbus-glib-0.110                GLib bindings for the D-BUS messaging system
erlang-runtime22-22.2.3        Functional programming language from Ericsson
expat-2.2.8                    XML 1.0 parser written in C
fftw3-3.3.8_5                  Fast C routines to compute the Discrete Fourier Transform
fontconfig-2.12.6,1            XML-based font configuration API for X Windows
freetype2-2.10.1               Free and portable TrueType font rendering engine
fswatch-0.02.b5_1              File system checksum checker
gcc-9_4                        Meta-port for the default version of the GNU Compiler Collection
gcc9-9.2.0                     GNU Compiler Collection 9
gdbm-1.18.1_1                  GNU database manager
gettext-runtime-0.20.1         GNU gettext runtime libraries and programs
ghostscript9-agpl-base-9.50    PostScript and PDF interpreter
giflib-5.2.1                   Tools and library routines for working with GIF images
git-2.24.1                     Distributed source code management tool
glib-2.56.3_6,1                Some useful routines of C programming (current stable version)
gmake-4.2.1_3                  GNU version of 'make' utility
gmp-6.1.2_1                    Free library for arbitrary precision arithmetic
gnome_subr-1.0                 Common startup and shutdown subroutines used by GNOME scripts
gnutls-3.6.11.1                GNU Transport Layer Security library
gobject-introspection-1.56.1,1 Generate interface introspection data for GObject libraries
gsfonts-8.11_8                 Standard Fonts for Ghostscript
indexinfo-0.3.1                Utility to regenerate the GNU info page index
inotify-tools-3.20.1           Command-line utilities to watch for file events
jbig2dec-0.17                  Decoder implementation of the JBIG2 image compression format
jbigkit-2.1_1                  Lossless compression for bi-level images such as scanned pages, faxes
jpeg-turbo-2.0.3               SIMD-accelerated JPEG codec which replaces libjpeg
lcms2-2.9                      Accurate, fast, and small-footprint color management engine
libICE-1.0.10,1                Inter Client Exchange library for X11
libSM-1.2.3,1                  Session Management library for X11
libX11-1.6.9,1                 X11 library
libXau-1.0.9                   Authentication Protocol library for X11
libXdmcp-1.1.3                 X Display Manager Control Protocol library
libdaemon-0.14_1               Lightweight C library that eases the writing of UNIX daemons
libffi-3.2.1_3                 Foreign Function Interface
libiconv-1.14_11               Character set conversion library
libidn-1.35                    Internationalized Domain Names command line tool
libidn2-2.3.0_1                Implementation of IDNA2008 internationalized domain names
libinotify-20180201_1          Kevent based inotify compatible library
liblqr-1-0.4.2                 Easy to use C/C++ seam carving library
libltdl-2.4.6                  System independent dlopen wrapper
liblz4-1.9.2,1                 LZ4 compression library, lossless and very fast
libnghttp2-1.40.0              HTTP/2.0 C Library
libpaper-1.1.24.4              Library providing routines for paper size management
libpthread-stubs-0.4           This library provides weak aliases for pthread functions
libraw-0.19.5                  Library for manipulating raw images
libtasn1-4.15.0                ASN.1 structure parser library
libunistring-0.9.10_1          Unicode string library
libwmf-nox11-0.2.8.4_15        Tools and library for converting Microsoft WMF (windows metafile)
libxcb-1.13.1                  The X protocol C-language Binding (XCB) library
libxml2-2.9.10                 XML parser library for GNOME
mpc-1.1.0_2                    Library of complex numbers with arbitrarily high precision
mpfr-4.0.2                     Library for multiple-precision floating-point computations
nettle-3.5.1_1                 Low-level cryptographic library
openjpeg-2.3.1                 Open-source JPEG 2000 codec
p11-kit-0.23.18.1              Library for loading and enumerating of PKCS#11 modules
p5-Authen-SASL-2.16_1          Perl5 module for SASL authentication
p5-CGI-4.44                    Handle Common Gateway Interface requests and responses
p5-Digest-HMAC-1.03_1          Perl5 interface to HMAC Message-Digest Algorithms
p5-Error-0.17028               Error/exception handling in object-oriented programming style
p5-GSSAPI-0.28_1               Perl extension providing access to the GSSAPIv2 library
p5-HTML-Parser-3.72            Perl5 module for parsing HTML documents
p5-HTML-Tagset-3.20_1          Some useful data table in parsing HTML
p5-IO-Socket-INET6-2.72_1      Perl module with object interface to AF_INET6 domain sockets
p5-IO-Socket-SSL-2.066         Perl5 interface to SSL sockets
p5-Mozilla-CA-20180117         Perl extension for Mozilla CA cert bundle in PEM format
p5-Net-SSLeay-1.85             Perl5 interface to SSL
p5-Socket6-0.29                IPv6 related part of the C socket.h defines and structure manipulators
p5-Term-ReadKey-2.38_1         Perl5 module for simple terminal control
p5-subversion-1.13.0           Perl bindings for Version control system
pcre-8.43_2                    Perl Compatible Regular Expressions library
perl5-5.30.1                   Practical Extraction and Report Language
pkg-1.12.0_1                   Package manager
pkgconf-1.6.3,1                Utility to help to configure compiler and linker flags
png-1.6.37                     Library for manipulating PNG images
pngwriter-0.7.0_2              C++ library for creating PNG images
poppler-data-0.4.9_1           Poppler encoding data
python37-3.7.6                 Interpreted object-oriented programming language
readline-8.0.1                 Library for editing command lines as they are typed
serf-1.3.9_4                   Serf HTTP client library
sqlite3-3.30.1                 SQL database engine in a C library
subversion-1.13.0              Version control system
sudo-1.8.31                    Allow others to run commands as root
tiff-4.1.0                     Tools and library routines for working with TIFF images
tpm-emulator-0.7.4_2           Trusted Platform Module (TPM) emulator
trousers-0.3.14_2              Open-source TCG Software Stack
utf8proc-2.4.0                 UTF-8 processing library
webp-1.0.3_1                   Google WebP image format conversion tool
wget-1.20.3                    Retrieve files from the Net via HTTP(S) and FTP
xorgproto-2019.2               xorg protocol headers
zip-3.0_1                      Create/update ZIP files compatible with PKZIP
good luck
Nikolas

--

---
You received this message because you are subscribed to the Google Groups "Zotonic developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotonic-develop...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages