GithubHelp home page GithubHelp logo

grrrr / flext Goto Github PK

View Code? Open in Web Editor NEW
117.0 17.0 23.0 2.87 MB

flext – C++ development layer for Pure Data and Max

Home Page: http://grrrr.org/research/software/flext

License: Other

Shell 0.55% Makefile 1.63% C++ 66.38% C 8.81% Batchfile 0.33% HTML 1.28% Assembly 0.35% Pascal 0.05% M4 0.98% NASL 1.02% Pawn 0.87% Max 17.75%
puredata pure-data maxmsp

flext's Introduction

flext - C++ layer for Max/MSP and Pd (Pure Data) externals

Copyright (c) 2001-2023 Thomas Grill ([email protected])
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.

This package seeks to encourage the development of open source software
for the pd and Max/MSP platforms.

Donations for further development of the package are highly appreciated.
https://www.paypal.com/xclick/business=gr%40grrrr.org&item_name=flext&no_note=1&tax=0&currency_code=EUR

----------------------------------------------------------------------------

Abstract:

flext seeks to represent a uniform programming interface for extending the most common
modular real-time audio systems Max/MSP and Pure Data (Pd) with external modules, or
short externals. These modules provide a way to tailor such a system for oneís
special needs and supply additional functionality.

Source code based on flext is able to exploit most common features of the
respective real-time framework while staying completely independent of the
actual host system and platform (hardware and operating system).

flext currently supports development for Pd under Linux, Windows and OSX as well as
Max/MSP under OS9, OSX and Windows with various programming environments.

----------------------------------------------------------------------------

Goals/features of the package:

pros:
- better readability of code compared to straight C externals
- faster development, more robust coding
- sharing of common methods and data by using base classes
- any input to any inlet (with the exception of signal streams)
- transparent use of threads for methods
- libraries of externals in Max/MSP
- more than 3 typed creation arguments possible for Max/MSP

cons:
- introduces a small overhead to speed of message and signal handling
- larger memory footprint

----------------------------------------------------------------------------

Prerequisites:

--- Pd ---
    You need the pd source code which is most likely part of the distribution.
    Otherwise download from: http://msp.ucsd.edu/software.html

--- Max/MSP ---
    You will need the latest Max/MSP SDK: https://cycling74.com/downloads/sdk

--- SndObj ---
    If you choose to compile with SndObj support you will need the respective library
    download from: http://www.may.ie/academic/music/musictec/SndObj/main.html

--- STK ---
    If you choose to compile with STK support you will need the respective package
    and build a library.
    download from: https://ccrma.stanford.edu/software/stk/
    For linking it may preferable to use a library of all the STK objects.

    Under linux you can create one from the STK directory with something like
    > g++ -c -pipe -I include -D __LINUX_OSS__ src/*.cpp && ar r libstk.a *.o && rm -f *.o

    Under Windows you can build a static STK library with the following commands:
    > cl src/*.c* /MT /D__OS_WINDOWS__ /EHsc /Ox /Iinclude /I../pthreads/include /c
    > lib *.obj /out:stk.lib
    Please note, that you have to have pthreads installed (../pthreads points to it in the command)
    Also, the resulting stk.lib will be a multithreaded build, linked to a static C library.
    Consequently you should also use multithreaded flext for your flext-based external.

----------------------------------------------------------------------------

Building and installing of flext and flext-based externals:

    See the build.txt document

----------------------------------------------------------------------------

Various notes / limitations / bug list:

    Read the notes.txt document

----------------------------------------------------------------------------

History of changes:

    Read the changes.txt document

flext's People

Contributors

carthach avatar grrrr avatar martinhn avatar mgeier avatar musicus avatar umlaeute avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flext's Issues

Syntax Error : max msvc building failure

Hi,

TL;DR : I face a syntax error when building flext under windows, although I successfuly built it under OSX.

I am trying to build flext for Max 7 with msvc.
After configuring config-win-max-msvc.txt, the second run of build max msvc build fails as follows :

------------------------------------------------

D:\Downloads\flext-master>nmake -f "D:\Downloads\flext-master\buildsys\nmake.mak" PLATFORM=win RTSYS=max COMPILER=msvc BUILDPATH=D:\Downloads\flext-master\buildsys\

Microsoft (R) Program Maintenance Utility Version 14.12.25835.0
Copyright (C) Microsoft Corporation. Tous droits réservés.

        "D:\Softwares\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\nmake.exe" /NOLOGO /f D:\Downloads\flext-master\buildsys\nmake-sub.mak  PLATFORM=win RTSYS=max COMPILER=msvc  BUILDPATH=D:\Downloads\flext-master\buildsys\ PKGINFO=package.txt BUILDCLASS=flext  USRCONFIG=config.txt USRMAKE=build\nmake-win-msvc.inc TARGETMODE=release TARGETTYPE=single _build_
        cl /c   /DNDEBUG /Ox /DWINVER=0x0501 /D_WIN32_WINNT=0x501 /DWIN_VERSION /DWIN_EXT_VERSION /YXflext.h /Fpmax-msvc\release-single\precompiled.pch /LD /EHsc /GR /Oi /nologo /D_CRT_SECURE_NO_DEPRECATE /DWIN32 /D_WINDOWS /MD  /DFLEXT_USE_SIMD /DFLEXT_EXPORTS /DFLEXT_SYS=1  /I"D:\Max_7\Packages\max-sdk-7.3.3\source\c74support"\max-includes /I"D:\Max_7\Packages\max-sdk-7.3.3\source\c74support"\jit-includes /I"D:\Max_7\Packages\max-sdk-7.3.3\source\c74support"\msp-includes source\flbase.cpp /Fomax-msvc\release-single\flbase.obj
cl : Ligne de commande warning D9002 : option '/YXflext.h' inconnue ignorée
flbase.cpp
d:\downloads\flext-master\source\flclass.h(1119): error C2061: erreur de syntaxe : identificateur 'Point'
NMAKE : fatal error U1077: '"D:\Softwares\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\cl.EXE"' : code retour '0x2'
Stop.
NMAKE : fatal error U1077: '"D:\Softwares\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\nmake.exe"' : code retour '0x2'
Stop.

D:\Downloads\flext-master>goto end

Sorry for that French command line tool (still cannot figure how to change its language).

So the error here is :

d:\downloads\flext-master\source\flclass.h(1119): error C2061: erreur de syntaxe : identificateur 'Point'
NMAKE : fatal error U1077:

Which translates as syntax error : indentifier 'Point'.
Identifier 'Point is only found in flclass.h in this bloc (ll.1115-1119) :

1115 #if FLEXT_SYS == FLEXT_SYS_MAX
1116    char **indesc,**outdesc;
1117
1118    static void cb_assist(flext_hdr *c,void *b,long msg,long arg,char *s);
1119        static void cb_click (flext_hdr *c, Point pt, short mods);

I can't find how to work around this error, since it lays in fext's source's headers...
PLUS I successfuly built flext and flext-based externals under OSX (using GCC) this week.
How can a syntax error be plateform-dependent ?

I also note the warning D9002 : unknown '/YXflext.h' option ignored...

If anyone has any insight on this...

TS

how to deal with Pd64 (double precision) externals?

this is more of a question than an issue:

when building flext as a dynamic library, you get something like libflext-pd.so against which flext-externals link.

however, afaiu libflext-pd.so will not be able to deal with multiple floatsizes (either it can handle Pd32 (single precision) or Pd64 (double precision); but not both).

so how should this be handled?

my naive suggestion would be:

RTE flext dylib
Pd32 libflext-pd.so
Pd64 libflext-pd64.so

but maybe you have better ideas...

Puredata: Input and output buffer ordering

I'm encountering a problem with the pointers to the inputs/outputs.
For some reason, when I create a 2-in-2-out object, the first input and the second output point to the same buffer/address.

Is this a bug? Or is my assumption flawed? Or did I do something strange in the instantiation?

My system: Puredata vanilla 0.49-1, OS X 10.14.1, Apple LLVM version 10.0.0 (clang-1000.11.45.5)

This simple external should enable you to reproduce the issue:

#include "flext.h"
#include <cassert>

#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401)
#error You need at least flext version 0.4.1
#endif

class TestObject : public flext_dsp
{
  FLEXT_HEADER(TestObject, flext_dsp)
  
public:
  TestObject()
  {
    AddInSignal("audio in 1");
    AddInSignal("audio in 2");
    AddOutSignal("audio out 1");
    AddOutSignal("audio out 2");
  }
  
protected:
  virtual void m_signal(int n, float *const *in, float *const *out) override;
};


FLEXT_NEW_DSP("TestObject~", TestObject)

void TestObject::m_signal(int n, float *const *in, float *const *out)
{
  // Inputs and outputs should not point to the same memory!
  assert(in[0] != out[0]);
  assert(in[0] != out[0]);
  assert(in[0] != out[1]);  // assertion triggers here!
  assert(in[0] != out[1]);
  assert(in[1] != out[0]);
  assert(in[1] != out[0]);
  assert(in[1] != out[1]);
  assert(in[1] != out[1]);

  // talk-through
  while (n--)
  {
    out[0][n] = in[0][n];
    out[1][n] = in[1][n];
  }
}

release?

I'm in the process of packaging flext for Debian (and derivatives).
However, for this to work I would need a "proper" release of flext (for me it's enough if you create a new tag)

So: is there an estimated timeline for the next flext (v0.5.1 iirc) release?

call-loop with FLEXT_USE_CMEM

Hello.

I ran into problems using FLEXT_USE_CMEM, it result in a call-loop:

void *operator new(size_t bytes) in flsupport.cpp calls flext_root::operator new(bytes);
which is inlined with: ::operator new(bytes); defined in flsupport.h
which calls the global new operator again.

Not sure what the idea was about FLEXT_USE_CMEM, but this seems wrong.
It looks like neither the global new operator nor the inline new-operator is necessary?

building from mingw windows 10 fails

Trying to build flext in order that I can get the py externals working on my system.

After adjusting all the file locations in config-win-max-mingw.txt I get the following:

mingw32-make -f C:/flext-master/buildsys/gnumake-sub.mak  PLATFORM=win RTSYS=max COMPILER=mingw BUILDPATH=C:/flext-master/buildsys/ PKGINFO=package.txt BUILDCLASS=flext USRCONFIG=config.txt USRMAKE=build/gnumake-win-mingw.inc TARGETMODE=release TARGETTYPE=single _build_
mingw32-make[1]: Entering directory 'C:/flext-master'
mingw32-make[1]: *** No rule to make target 'max-mingw\release-single/flbase.opp', needed by 'max-mingw\release-single\libflext-max_s.LIB'.  Stop.
mingw32-make[1]: Leaving directory 'C:/flext-master'
C:\flext-master\buildsys\targets.inc:62: recipe for target 'build-release-single' failed
mingw32-make: *** [build-release-single] Error 2

Here's the first part of my config file:

# where are the Max/MSP SDK header files?
# you should have the latest version!
MAXSDKPATH="C:\Program Files (x86)\Cycling '74\Max 7\resources\packages\max-sdk-7.3.3\source\c74support"

###############################################################

# where do/should the flext headers reside/be built?
FLEXTINC="C:\Program Files (x86)\Cycling '74\Max 7\flext"

# where do/should the flext static libraries reside/be built?
FLEXTLIB=$(FLEXTINC)

# where do/should the flext shared libraries reside/be built?
# (a good place is the MaxMSP program folder)
FLEXTSHLIB="C:\Program Files (x86)\Cycling '74\Max 7"

###############################################################

# where should the external be built?
# (path for temporary files)
OUTPATH=max-mingw

# where should the external be installed?
INSTPATH="C:\Program Files (x86)\Cycling '74\Max 7\externals\flext"

# where should the initialization files be installed?
INITPATH="C:\Program Files (x86)\Cycling '74\Max 7\resources\init"

# where should the help files be installed?
HELPPATH="C:\Program Files (x86)\Cycling '74\Max 7\resources\help\flext"

###############################################################

provide pkg-config file for the proper build-flags for externals

it would be great to have a @[email protected] file (or similar), that outputs the proper CFLAGS and LIBS for dynamically linking with flext on @System@.

e.g.

 $ pkg-config --cflags pd-flext
 -I/usr/local/include/flext -DPD -DFLEXT_SHARED
 $ pkg-config --libs pd-flext
 -lflext-pd

lower priority: pkg-config also has a --static flags that outputs flags for static linking:

 $ pkg-config --static --cflags pd-flext
 -I/usr/local/include/flext -DPD
 $ pkg-config --static --libs pd-flext
 -lflext-pd_s

building failed

Hi, so I'm trying to build and install flext.

at step 1.2 "Building and installing flext" I entered "bash build.sh pd gcc" into the terminal, then "buildsys/config-mac-max-gcc.txt" was created and I edited it to refer to the new Pd Vanilla's path, so all I did was, instead of Pd-042-5 including "PDPATH=/Applications/Pd-0.47-1-64bit.app/Contents/Resources"

then I tried building it again and got three errors, here's everything...



A default package configuration file has been created.
Please edit config.txt, then start again.

make: *** [config.txt] Error 1
Alexandres-MacBook-Pro:flext-master porres$ bash build.sh pd gcc
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f ./buildsys/gnumake-sub.mak PLATFORM=mac RTSYS=pd COMPILER=gcc BUILDPATH=./buildsys/ PKGINFO=package.txt BUILDCLASS=flext USRCONFIG=config.txt USRMAKE=build/gnumake-mac-gcc.inc TARGETMODE=release TARGETTYPE=single build
buildsys/mac/gnumake-gcc-targets.inc:22: warning: overriding commands for target pd-darwin/release-single' buildsys/mac/gnumake-gcc-targets.inc:18: warning: ignoring old commands for target pd-darwin/release-single'
mkdir -p pd-darwin/release-single
mkdir -p pd-darwin/release-single/
c++ -c -ffast-math -mmacosx-version-min=10.6 -O3 -mtune=native -DFLEXT_USE_SIMD -DNDEBUG -DFLEXT_EXPORTS -DFLEXT_SYS=2 -DPD -I/Applications/Pd-0.47-1-64bit.app/Contents/Resources/src -I/Applications/Pd-0.47-1-64bit.app/Contents/Resources/include -I/Applications/Pd-0.47-1-64bit.app/Contents/Resources/include/pd source/flext.h -o pd-darwin/release-single/flext.h.gch
clang: warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated [-Wdeprecated]
In file included from source/flext.h:60:
In file included from source/flclass.h:18:
In file included from source/flbase.h:19:
source/flsupport.h:130:1: warning: replacement function 'operator new' cannot be
declared 'inline' [-Winline-new-delete]
inline void *operator new(size_t bytes) NEWTHROW { return flext_root::op...
^
source/flsupport.h:131:1: warning: replacement function 'operator delete' cannot
be declared 'inline' [-Winline-new-delete]
inline void operator delete(void *blk) DELTHROW { flext_root::operator d...
^
source/flsupport.h:133:1: warning: replacement function 'operator new[]' cannot
be declared 'inline' [-Winline-new-delete]
inline void *operator new[](size_t bytes) NEWTHROW { return flext_root::...
^
source/flsupport.h:134:1: warning: replacement function 'operator delete[]'
cannot be declared 'inline' [-Winline-new-delete]
inline void operator delete[](void *blk) DELTHROW { flext_root::operato...
^
source/flsupport.h:236:53: error: assigning to 't_float' (aka 'float') from
incompatible type 't_word' (aka 'word')
Element(FLEXT_ARRAYTYPE s) { FLEXT_GETSAMPLE(el) = s; }
^ ~
source/flsupport.h:237:42: error: non-const lvalue reference to type 't_word'
(aka 'word') cannot bind to a value of unrelated type 't_float'
(aka 'float')
...operator FLEXT_ARRAYTYPE &() { return FLEXT_GETSAMPLE(el); }
^~~~~~~~~~~~~~~~~~~
source/flsupport.h:219:43: note: expanded from macro 'FLEXT_GETSAMPLE'

define FLEXT_GETSAMPLE(x) ((x).w_float)

                                      ^~~~~~~~~~~~~

source/flsupport.h:238:47: error: no viable conversion from returned value of
type 'const t_float' (aka 'const float') to function return type 't_word'
(aka 'word')
...operator FLEXT_ARRAYTYPE () const { return FLEXT_GETSAMPLE(el); }
^~~~~~~~~~~~~~~~~~~
source/flsupport.h:219:43: note: expanded from macro 'FLEXT_GETSAMPLE'

define FLEXT_GETSAMPLE(x) ((x).w_float)

                                      ^~~~~~~~~~~~~

/Applications/Pd-0.47-1-64bit.app/Contents/Resources/src/m_pd.h:151:15: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const t_float' (aka 'const float') to 'const word &' for
1st argument
typedef union word
^
4 warnings and 3 errors generated.
make[1]: *** [pd-darwin/release-single/flext.h.gch] Error 1
make: *** [build-release-single] Error 2
Alexandres-MacBook-Pro:flext-master porres$

Duplicate symbol for new / delete since pulling latest changes

Hi...

Since pulling the latest version of Flext master into my project, I am getting link errors:

duplicate symbol 'operator delete[](void*)' in:
    /Volumes/Storage/jamie/Library/Developer/Xcode/DerivedData/ml-cegbtphjlzgqndapbzubbuwhzqli/Build/Intermediates.noindex/ml.build/Development/ml.knn pd.build/Objects-normal/x86_64/ml_base.o
    /Volumes/Storage/jamie/Library/Developer/Xcode/DerivedData/ml-cegbtphjlzgqndapbzubbuwhzqli/Build/Intermediates.noindex/ml.build/Development/ml.knn pd.build/Objects-normal/x86_64/ml_regression.o
duplicate symbol 'operator new(unsigned long)' in:
    /Volumes/Storage/jamie/Library/Developer/Xcode/DerivedData/ml-cegbtphjlzgqndapbzubbuwhzqli/Build/Intermediates.noindex/ml.build/Development/ml.knn pd.build/Objects-normal/x86_64/ml_base.o
    /Volumes/Storage/jamie/Library/Developer/Xcode/DerivedData/ml-cegbtphjlzgqndapbzubbuwhzqli/Build/Intermediates.noindex/ml.build/Development/ml.knn pd.build/Objects-normal/x86_64/ml_regression.o

etc

I am defining FLEXT_USE_CMEM which used to fix this (I think).
I am also using FLEXT_INLINE and FLEXT_USESIMD

Any ideas?

Fix startup of helper threads

Startup of secondary threads in flext::StartHelper (flthr.cpp) and flext_base::StartQueue (flqueue.cpp) use (non-thread-safe) static variables as flags and Sleep() calls to wait for startup. This is very unelegant and error-prone.

`-framework veclib` should be `-framework Accelerate`

On Yosemite, both for PD and Max builds I was getting the error:

ld: framework not found vecLib

It looks like that name has been deprecated for some time and now doesn't work any more. Just changing vecLib to Accelerate in buildsys/mac/gnumake-gcc.inc got me building again.

trouble building flext

followed the instructions but I'm stuck at this point:

Omars-MacBook-Pro:flext-master omar$ bash build.sh max gcc
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f ./buildsys/gnumake-sub.mak PLATFORM=mac RTSYS=max COMPILER=gcc BUILDPATH=./buildsys/ PKGINFO=package.txt BUILDCLASS=flext USRCONFIG=config.txt USRMAKE=build/gnumake-mac-gcc.inc TARGETMODE=release TARGETTYPE=single build
buildsys/mac/gnumake-gcc-targets.inc:22: warning: overriding commands for target max-darwin/release-single' buildsys/mac/gnumake-gcc-targets.inc:18: warning: ignoring old commands for target max-darwin/release-single'
mkdir -p max-darwin/release-single
mkdir -p max-darwin/release-single/
c++ -c -ffast-math -mmacosx-version-min=10.6 -Os -mtune=native -DFLEXT_USE_SIMD -DNDEBUG -DFLEXT_EXPORTS -DFLEXT_SYS=1 -I/Applications/max-sdk-8.0.3/source/c74support/max-includes -I/Applications/max-sdk-8.0.3/source/c74support/jit-includes -I/Applications/max-sdk-8.0.3/source/c74support/msp-includes source/flext.h -o max-darwin/release-single/flext.h.gch
clang: warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated [-Wdeprecated]
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use
the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from source/flext.h:60:
In file included from source/flclass.h:18:
In file included from source/flbase.h:18:
source/flstdc.h:30:10: fatal error: 'cassert' file not found
#include
^~~~~~~~~
1 warning and 1 error generated.
make[1]: *** [max-darwin/release-single/flext.h.gch] Error 1
make: *** [build-release-single] Error 2

can you help?
(I really want to be able to try py external!)

Mac OS ARM build not working

Here is what I see:

</c/flext> sh build.sh pd gcc build
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f ./buildsys/gnumake-sub.mak PLATFORM=mac RTSYS=pd COMPILER=gcc BUILDPATH=./buildsys/ PKGINFO=package.txt BUILDCLASS=flext USRCONFIG=config.txt USRMAKE=build/gnumake-mac-gcc.inc TARGETMODE=release TARGETTYPE=single build
buildsys/mac/gnumake-gcc-targets.inc:22: warning: overriding commands for target pd-darwin/release-single' buildsys/mac/gnumake-gcc-targets.inc:18: warning: ignoring old commands for target pd-darwin/release-single'
mkdir -p ./
c++ -c -I/opt/local/include -ffast-math -mmacosx-version-min=10.9 -O3 -mtune=native -I/opt/local/include -std=c++11 -fvisibility-inlines-hidden -arch i386 -DFLEXT_USE_SIMD -DNDEBUG -DFLEXT_EXPORTS -DFLEXT_SYS=2 -DPD -I pd-darwin/release-single -I/Applications/jos/Pd-0.52-2.app/Contents/Resources/src -I/Applications/jos/Pd-0.52-2.app/Contents/Resources/include -I/Applications/jos/Pd-0.52-2.app/Contents/Resources/include/pd source/flbase.cpp -o pd-darwin/release-single/flbase.opp_i386
error: unknown target CPU 'apple-a12'
note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, geode
make[1]: *** [pd-darwin/release-single/flbase.opp_i386] Error 1
make: *** [build-release-single] Error 2

Problems with dynamic exception specifications on C++17 (macOS)

When trying to compile flext-based externals on Github Actions/macOS, I'm getting errors like these:

/usr/local/include/flext/flsupport.h:134:34: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
void *operator new(size_t bytes) NEWTHROW;
                                 ^~~~~~~~
/usr/local/include/flext/flsupport.h:126:18: note: expanded from macro 'NEWTHROW'
#define NEWTHROW throw(std::bad_alloc)
                 ^~~~~~~~~~~~~~~~~~~~~
/usr/local/include/flext/flsupport.h:134:34: note: use 'noexcept(false)' instead
void *operator new(size_t bytes) NEWTHROW;
                                 ^~~~~~~~
                                 noexcept(false)
/usr/local/include/flext/flsupport.h:126:18: note: expanded from macro 'NEWTHROW'
#define NEWTHROW throw(std::bad_alloc)
                 ^

When I comment a few things out in source/flsupport.h (lines 126 and 127):

#define NEWTHROW /*throw(std::bad_alloc)*/
#define DELTHROW /*throw()*/

... those errors are gone, but instead of them there are some warnings:

source/flsupport.h:134:7: warning: 'operator new' is missing exception specification 'throw(std::bad_alloc)' [-Wmissing-exception-spec]
void *operator new(size_t bytes) NEWTHROW;
      ^
                                 throw(std::bad_alloc)
/Applications/Xcode_11.5.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/new:186:66: note: previous declaration is here
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;

Despite those warnings, the externals are successfully created: https://github.com/mgeier/ssr/actions/runs/136504305

I don't know whether they actually work as expected, though, because I don't have a Mac to test them.

I have no idea what's the right course of action is here, I just wanted to report my experiences ...

On Linux (GCC) everything works fine, BTW.

release tag v0-5-1

why is v0.5.1 a direct successor of v0.6.0?
should the tag read v0-6-1 instead?

Bus error

Hello.

I ran into problems using flext when compiling externals (into a library) without using FLEXT_USE_CMEM on a bela (using a xenomai linux).
I did not dig deep - but it results in a Bus Error

On a desktop linux (archlinux) it does not show this behaviour - the externals load and work fine.

Any ideas where this may come from?

dyn~

Is dyn~ / dynext dead?

Questions: maintenance status / support for GEM and Jitter

Hello,

We are looking to writing externals for Jitter (in Max) and GEM (in Pd).
Our library is in C++, so I thought flext would be a good fit.

Questions are:

  • is this project still maintained and still can work agains the most recent Max and Pd versions?
  • I am also looking for Jitter and GEM examples of externals that compile with this

I saw some forks of this have newer material that is not in this repo so I guess there is still interest in this.

dynamically linking externals (using Pd)

it seems that i cannot properly link against the dynamic library of flext.

My rough Makefile (i've used make install DESTDIR=/tmp/flex for pseudo-installing flext):

FLEXTDIR=/tmp/flex/usr/local/
CXXFLAGS=-DPD -I$(FLEXTDIR)/include/flext -I/usr/include/pd -fPIC -DPIC
LDFLAGS=-rdynamic -shared -Wl,-rpath,"\$ORIGIN",--enable-new-dtags -fPIC
LIBS=$(LDFLAGS) -L$(FLEXTDIR)/lib -lflext-pd_d

henon.pd_linux: henon.o
    g++ -o $@ $< $(CXXFLAGS) $(LIBS)

henon.o: henon.cpp
    g++ -o $@ -c $< $(CXXFLAGS)

this gives me a nice henon.pd_linux.
But when I run it, it cannot be loaded with the error

./henon.pd_linux: ./henon.pd_linux: undefined symbol: _ZN17flext_base_single4InitEv

which translates to flext_base_single::Init() not being found.

everything works fine when i link against the static version of flext -lflext-pd_s

Crash on OS X when optimizations are enabled -- memory allocation issue?

I'm experiencing a weird crash on OS X 10.14.1 (Mojave) with any externals built with flext.

When I try to load a (flext-based) external, the app just closes / crashes.
I don't see any log entry in the system log nor the pd console (after I restart it).

What I did:

  1. built and installed flex with build.sh (edited config file to match my installation, then build and install)
  2. I build one of the tutorial externals (e.g. simple1 or signal1~) - by going into the tutorial/simple1 directory and then doing a ../../build.sh pd gcc
  3. Install the built external
  4. start puredata
  5. create a new patch and (try to) add a new object

Is there another place where I could look for hints on why it crashes?

I'm using pd-0.49-1 and gcc -v yields:

Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin```

building for 64-bit Pd on Windows

hi,

i'm trying to build flext for 64-bit Pd (amd64, not double precision) on Windows 10 using MSVC. since MSVC doesn't allow inline assembly on 64-bit, this fails on flsimd.cpp and (with SIMD disabled) lockfree/cas.hpp.

is it possible to do a 64-bit build? should i be using MinGW or Cygwin instead of MSVC?

Problem installing flext

trying to install Flext in Mac OS Mojave I have having this error:
When I run this command in terminal bash build.sh pd gcc

/Library/Developer/CommandLineTools/usr/bin/make -f ./buildsys/gnumake-sub.mak  PLATFORM=mac RTSYS=pd COMPILER=gcc BUILDPATH=./buildsys/ PKGINFO=package.txt BUILDCLASS=flext USRCONFIG=config.txt USRMAKE=build/gnumake-mac-gcc.inc TARGETMODE=release TARGETTYPE=single _build_
buildsys/mac/gnumake-gcc-targets.inc:22: warning: overriding commands for target `pd-darwin/release-single'
buildsys/mac/gnumake-gcc-targets.inc:18: warning: ignoring old commands for target `pd-darwin/release-single'
mkdir -p pd-darwin/release-single/
c++ -c -ffast-math -mmacosx-version-min=10.6  -O3 -mtune=native  -DFLEXT_USE_SIMD -DNDEBUG -DFLEXT_EXPORTS -DFLEXT_SYS=2 -DPD -I/Applications/Pd-0.42-5.app/Contents/Resources/src -I/Applications/Pd-0.42-5.app/Contents/Resources/include -I/Applications/Pd-0.42-5.app/Contents/Resources/include/pd source/flext.h -o pd-darwin/release-single/flext.h.gch
clang: warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated [-Wdeprecated]
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from source/flext.h:60:
In file included from source/flclass.h:18:
In file included from source/flbase.h:18:
source/flstdc.h:30:10: fatal error: 'cassert' file not found
#include <cassert>
         ^~~~~~~~~
1 warning and 1 error generated.
make[1]: *** [pd-darwin/release-single/flext.h.gch] Error 1
make: *** [build-release-single] Error 2

I have tried to put the flag in buildsys/mac/gnumake-gcc.in but it is not changing nothing....
CXXFLAGS += -std=libc++

##############################################

ifneq (,$(findstring Frameworks,$(FLEXTPREFIX)))
FLEXTFRAMEWORK := $(FLEXTPREFIX)/flext.framework
endif

ifdef FLEXTFRAMEWORK
ifndef FLEXTLIB
FLEXTLIB := $(FLEXTFRAMEWORK)
endif
ifndef FLEXTINC
FLEXTINC := $(FLEXTFRAMEWORK)/Headers
endif
ifndef FLEXTSYS
FLEXTSYS := $(FLEXTFRAMEWORK)/Resources
endif
else
ifndef FLEXTLIB
FLEXTLIB := $(FLEXTPREFIX)/lib
endif
ifndef FLEXTINC
FLEXTINC := $(FLEXTPREFIX)/include/flext
endif
ifndef FLEXTSYS
FLEXTSYS := $(FLEXTPREFIX)/lib/flext
endif
endif

FLEXTBIN := $(FLEXTPREFIX)/bin

##############################################

CXXFLAGS += -fvisibility-inlines-hidden 
CXXFLAGS += -std=libc++
LDFLAGS += -dynamic -framework Accelerate

##############################################

ifdef DEBUG
CFLAGS += -g
LDFLAGS += -g
else
ifdef PROFILE
CFLAGS += -g
LDFLAGS += -g
else
LDFLAGS += -Wl,-S
endif
endif

##############################################

ifdef STK_INC
INCPATH += -I$(STK_INC)
endif
ifdef STK_LIB
LIBS += $(STK_LIB)
endif

##############################################

ifdef SNDOBJ_INC
INCPATH += -I$(SNDOBJ_INC)
endif
ifdef SNDOBJ_LIB
LIBS += $(SNDOBJ_LIB)
endif

##############################################

ifdef LOCKFREE
INCPATH += -I$(LOCKFREE)
endif

ifdef ATOMIC_OPS
INCPATH += -I$(ATOMIC_OPS)/src
DEFS += -DUSE_ATOMIC_OPS
endif

##############################################

LDFLAGS += $(patsubst %,-arch %,$(ARCH))

ifdef OSXSDK
CFLAGS += -isysroot $(OSXSDK)
LDFLAGS += -isysroot $(OSXSDK)
endif

My compiler version is:

Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Thank you so much.

automake 'foreign'

when initializing automake, the foreign option should be passed (since a number of files (e.g. README) required to be strictly GNU autotools conformant) are missing.

e.g. configure.ac:10

 AM_INIT_AUTOMAKE([foreign])

this is needed to bootstrap the project with the standard autoreconf -fiv (instead of ./bootstrap.h which adds the --foreign manually)

Autoconf installation --with-stk and --with-sndobj buggy

Misleading output of --help regarding --with options
When .configure the package, in the help it is written that options to provide STK and SndObj headers are --with-stk and --witch-sndobj, however configure script doesn't recognize them.
I figured out that correct options are similar to --with-sdkdir and need to include dir in the end: --with-stkdir and --with-sndobjdir
Final command that worked for me:

./configure --with-stkdir=/usr/include/stk --with-sndobjdir=/usr/include/SndObj --with-sdkdir=/usr/include/pd

Include dirs messed up
After ./configure script succeeded and both SndObj and STK were enabled (I inspected configure.status and Makefile) actual compilation fails with error

flbase.cpp:31:22: fatal error: g_canvas.h: No such file or directory

that apparently means that somehow even if configure script confirmed the file exists (it actually exists, I checked), include dirs are not properly passed to the compiler.

Further investigation confirms that SndObj and STK include paths somehow overwrite instead of appending to include path given to compiler, because building flext without them succeeds.

Building via build.sh works without problem

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.