diff --git a/README.md b/README.md new file mode 100644 index 0000000..e7f357f --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# SIMD +*The code powering [simd.jaytux.com](https://simd.jaytux.com)* + +This service provides a RESTful API for C/C++ intrinsics, with a slight focus on SIMD intrinsics. The data is currently sourced from [Intel](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#), but I'd like to incorporate AMD performance data, as well as intrinsics from ARM and/or PowerPC. + +## Project Structure +- `/api/`: the code powering the API itself (using Ktor in Kotlin); +- `/frontend/`: the code powering the desktop and web frontends (using Compose Multiplatform). + +See the respective directories for details on setup/dependencies/building/running. diff --git a/api/README.md b/api/README.md index ddf7c4a..d5c6e2d 100644 --- a/api/README.md +++ b/api/README.md @@ -25,6 +25,8 @@ 5. At this point, you are ready to load the data into the database using the application. Run `./gradlew run -reload /path/to/post-processed/data.js /path/to/post-processed/perf2.js` 6. Finally, you can start the application using `./gradlew run` +You can also use the `./package.sh` script to build a standalone executable (with bundled JVM).You can also use the `./package.sh` script to build a standalone executable (with bundled JVM). It uses the Gradle `shadowJar` target together with `jpackage`. + ## Running By default, the application runs on port `42024`. You can start it using `./gradlew run`. diff --git a/frontend/README.md b/frontend/README.md index 13e2e76..7a7c70f 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,18 +1,20 @@ -This is a Kotlin Multiplatform project targeting Web, Desktop. +# Intrinsics UI +*The UI powering [https://simd.jaytux.com](https://simd.jaytux.com)* -* `/composeApp` is for code that will be shared across your Compose Multiplatform applications. - It contains several subfolders: - - `commonMain` is for code that’s common for all targets. - - Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name. - For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app, - `iosMain` would be the right folder for such calls. +## Running +The Gradle wrapper (`./gradlew`) in the repository can be used to run the project. +Currently, two targets are available: +- **Web**: The web application uses Kotlin's WASM/JS target and is "optimized" for landscape mode. I am planning to add a portrait mode in the future (together with an Android/iOS version). There are three important Gradle tasks: + - `wasmJsBrowserRun`: runs the web application (mostly used for development); + - `wasmJsBrowserDistribution`: builds a distribution of the web application, which can be statically served; + - `wasmJsBrowserProductionWebpack`: builds a production-ready web application, which can be statically served (this target takes a lot longer to build, but should be more performant/smaller in code size). +- **Desktop/JVM**: The desktop application uses Kotlin's JVM target. It has a few important Gradle tasks: + - `desktopRun`: runs the desktop application (mostly used for development); + - `packageAppImage`, `packageDeb`, `packageDmg`, `packageMsi`: packages the desktop application for distribution on various platforms (Linux, MacOS, Windows). +The web distribution can be found in `composeApp/build/dist/wasmJs`, and the desktop distribution in `composeApp/build/compose/binaries/main/app`. -Learn more about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html), -[Compose Multiplatform](https://github.com/JetBrains/compose-multiplatform/#compose-multiplatform), -[Kotlin/Wasm](https://kotl.in/wasm/)… +You can also use the `./package.sh` script to build both (for Desktop, the AppImage will be built). This script also generates a compressed archive (`.tar.gz`) for both. -We would appreciate your feedback on Compose/Web and Kotlin/Wasm in the public Slack channel [#compose-web](https://slack-chats.kotlinlang.org/c/compose-web). -If you face any issues, please report them on [GitHub](https://github.com/JetBrains/compose-multiplatform/issues). - -You can open the web application by running the `:composeApp:wasmJsBrowserDevelopmentRun` Gradle task. \ No newline at end of file +## Configuring +The only configuration is the backend URL. At the moment, it is set explicitly in the code, but I might change that. To change it, change the value `com.jaytux.simd.frontend.client.Client.baseUrl` in `/composeApp/src/commonMain/kotlin/com/jaytux/simd/frontend/client/Client.kt`. \ No newline at end of file diff --git a/frontend/package.sh b/frontend/package.sh index dbc4dd2..6a53d0e 100755 --- a/frontend/package.sh +++ b/frontend/package.sh @@ -29,8 +29,8 @@ echo "" tar -czf simd-frontend@linux.tar.gz -C composeApp/build/compose/binaries/main/app/ com.jaytux.simd.frontend echo "" -echo "+----------------------------------------------------------------------------------------+" -echo "| tar -czf simd-frontend@web.tar.gz -C composeApp/build/dist/wasmJs productionExecutable |" -echo "+----------------------------------------------------------------------------------------+" +echo "+--------------------------------------------------------------------------------------------------+" +echo "| tar -czf simd-frontend@web.tar.gz -C composeApp/build/kotlin-webpack/wasmJs productionExecutable |" +echo "+--------------------------------------------------------------------------------------------------+" echo "" -tar -czf simd-frontend@web.tar.gz -C composeApp/build/dist/wasmJs productionExecutable \ No newline at end of file +tar -czf simd-frontend@web.tar.gz -C composeApp/build/kotlin-webpack/wasmJs productionExecutable